<!--菜单属性块-->
<template>
  <div class="h100p" style="position: relative; padding-left: 5px">
    <el-scrollbar style="height: 100%;" :style="{paddingTop: $route.path == '/home/projectTwo' ? '45px' : ''}">
      <el-collapse accordion v-model="activeName">
        <el-collapse-item :name="1" v-show=" currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
          <template slot="title"> 工具属性 </template>
          <!-- <div class="projectPropsDescText">{{currentNodeItem.description}}</div> -->
          <div class="" style="padding: 5px 5px 5px 10px">
            <p>名称：<span>{{currentNodeItem.name}}</span></p>
            <p>开发者：<span>{{ currentNodeItem.responsible }}</span></p>
<!--            <p>组件可用范围：<span>开发团队</span></p>-->


<!--            v-if="$route.path == '/home/project'"-->
            <p>版本：<span>{{currentNodeItem.version}}</span></p>
<!--            <p v-if="$route.path == '/home/project'">量级：<span>{{currentNodeItem.measure}}</span></p>-->

<!--            v-if="$route.path == '/home/project'"-->
            <p>专业：<span>{{currentNodeItem.domain}}</span></p>

            <p>描述：<span>{{currentNodeItem.description}}</span></p>
<!--            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' ">版本：<span>{{currentNodeItem.version}}</span></p>-->

<!--            <p v-if="currentNodeItem.domain">领域：<span>{{currentNodeItem.domain}}</span></p>-->
<!--            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' ">领域：<span>{{currentNodeItem.domain}}</span></p>-->

<!--            <p v-if="currentNodeItem.webUI">访问地址：<span>{{currentNodeItem.webUI}}</span></p>-->
            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'
            && $route.path !== '/home/projectTwo' ">访问地址：<span>{{currentNodeItem.webUI}}</span></p>

<!--            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' ">单位：<span>{{currentNodeItem.measure || ''}}</span></p>-->

            <!--            <p v-if="currentNodeItem.department">部门：<span>{{currentNodeItem.department}}</span></p>-->
            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' ">部门：<span>{{currentNodeItem.department}}</span></p>

            <!--<p v-if="currentNodeItem.secretLevel">密级：<span>{{currentNodeItem.secretLevel}}</span></p>-->
            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' ">密级：<span>{{currentNodeItem.secretLevel}}</span></p>







<!--            <p v-if="currentNodeItem.modelPath">所在位置：<span>{{currentNodeItem.modelPath}}</span></p>-->
<!--            <p v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' ">所在位置：<span>{{currentNodeItem.modelPath}}</span></p>-->

          </div>

        </el-collapse-item>
<!--        <div style="max-height: 580px; overflow: auto; background: #fff">-->


        <!-- <el-collapse-item :name="2">
          <template slot="title">
            输入/输出属性
          </template>
          <div class="" style="padding:10px 5px 10px 5px">
            <el-form  label-width="90px">
             <template v-if="unstructurIntList.length>0">
               输入属性：
              <el-form-item :label="item.key" v-for="(item,index) in unstructurIntList" :key="index">
                 <el-input size="mini"  v-model="item.value" ></el-input>
              </el-form-item>
             </template>
              <template v-if="unstructurOutList.length>0">
                输出属性：
              <el-form-item :label="item.key" v-for="item in unstructurOutList" :key="item.id">

                 <el-input size="mini"  v-model="item.value"></el-input>
              </el-form-item>
              </template>
            </el-form>
          </div>
        </el-collapse-item> -->


<!--        组件功能设置 -->
<!--        组件功能设置 -->
<!--        组件功能设置 -->
<!--        组件功能设置 -->

<!--        <el-collapse-item style="margin-top: -5px" :name="2" -->
<!--                          v-if="currentNodeItem.targetAlgorithm == 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' && $route.path !== '/home/projectTwo'">-->
<!--          <template slot="title"> 组件功能设置 </template>-->
<!--          <div class="" style="padding: 10px 5px 10px 5px">-->
<!--            <el-form label-width="100px">-->
<!--              <el-form-item label="选择操作：">-->
<!--                <el-select-->
<!--                  size="mini"-->
<!--                  v-model="selectValue"-->
<!--                  placeholder="请选择"-->
<!--                  @change="handleChangeSel">-->
<!--                  <el-option-->
<!--                    v-for="item in seletItem"-->
<!--                    :key="item.id"-->
<!--                    :label="item.name"-->
<!--                    :value="item.type"></el-option>-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--              <el-form-item label="原文件地址：" v-if="selectValue == 'rename'">-->
<!--                <el-input-->
<!--                  size="mini"-->
<!--                  placeholder="请输入原文件地址"-->
<!--                  v-model="renameFile.originalFileAddress"-->
<!--                  style="width: 63%"></el-input>-->
<!--              </el-form-item>-->
<!--              <el-form-item label="文件名称：" v-if="selectValue == 'rename'">-->
<!--                <el-input-->
<!--                  size="mini"-->
<!--                  placeholder="请输入重命名"-->
<!--                  v-model="renameFile.newFileAddress"-->
<!--                  style="width: 63%"></el-input>-->
<!--              </el-form-item>-->

<!--              <el-form-item-->
<!--                label="上传文件："-->
<!--                v-if="selectValue == 'selectionParam' && $route.path == '/home/projectTwo'">-->
<!--                <el-upload-->
<!--                  class="upload-demo"-->
<!--                  drag-->
<!--                  :headers="config"-->
<!--                  accept=".csv,.txt"-->
<!--                  :action="urlAction"-->
<!--                  :on-remove="handleRemove"-->
<!--                  :on-change="fileAdd">-->
<!--                  <i class="el-icon-upload"></i>-->
<!--                  <div class="el-upload__text">-->
<!--                    将文件拖到此处，或<em>点击上传</em>-->
<!--                  </div>-->
<!--                </el-upload>-->
<!--                <el-upload-->
<!--                  class="upload-demo"-->
<!--                  drag-->
<!--                  :headers="config"-->
<!--                  accept=".csv,.txt"-->
<!--                  :action="urlAction"-->
<!--                  :on-remove="handleRemove"-->
<!--                  :on-change="fileAdd">-->
<!--                  <i class="el-icon-upload"></i>-->
<!--                  <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>-->
<!--                </el-upload>-->
<!--              </el-form-item>-->
<!--              <el-button type="primary"-->
<!--                         @click="confirmReNameFunc"-->
<!--                         size="mini"-->
<!--                         style="width: 100%; margin-top: 20px"-->
<!--                         v-if="selectValue == 'rename' && $route.path == '/home/project' ">保存</el-button>-->
<!--            </el-form>-->
<!--          </div>-->
<!--        </el-collapse-item>-->



<!--        this.$route.path === '/home/project' &&-->
        <el-collapse-item :name="3" v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
<!--          <template slot="title"> 组件责任人 </template>-->
          <template slot="title"> 工具运行人 </template>

<!--          this.$route.path === '/home/project' &&-->
          <div style="height: 30px;line-height: 30px;padding: 10px 5px 100px 10px;border-top:1px solid #EBEEF5;"
               v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
            组件责任人：
            <el-select v-model="compPersonLiable"
                       :disabled="$route.path !== '/home/project'"
                       placeholder="请选择组件责任人"
                       multiple
                       @change="chooseCompPersonLiableFunc"
                       size="mini" style="width: 250px;display: inline-block;">
              <el-option
                size="mini"
                :disabled="$route.path !== '/home/project'"
                v-for="(item,index) in thisProjectAllMember"
                :key="index"
                :label="item"
                :value="item">
              </el-option>
            </el-select>

<!--            <span v-for="(item,index) in compPersonLiable">{{item + ' ， '}}</span>-->

          </div>
        </el-collapse-item>

        <el-collapse-item :name="4"
                          v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' && currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">
          <template slot="title"> 工具输入 </template>

          <div style="max-height: 745px; overflow: auto; background: #fff">
            <el-scrollbar style="height: 100%">
              <!-- <template slot="title">
             文件目录
            </template> -->
              <div class="" style="padding: 5px 10px 0 0">
                <el-form @submit.native.prevent>
                  <template>
                    <el-form-item>
                    </el-form-item>
                  </template>
                </el-form>
                <el-table
                  v-if="this.tableData.length > 0"
                  :data="tableData"
                  height="180px"
                  :header-cell-style="{ textAlign: 'center' }">
                  <el-table-column label="字段名称" align="center" prop="field">
                    <!-- <template slot-scope="scope">
                      {{ scope.row.field}}
                   </template> -->
                  </el-table-column>
                  <el-table-column label="类型" align="center" prop="fieldType">
                    <!-- <template slot-scope="scope">
                      {{ scope.row.fieldType}}
                   </template> -->
                  </el-table-column>
                  <el-table-column label="描述" align="center">
                    <template slot-scope="scope"> </template>
                  </el-table-column>
                </el-table>

                <!--inputData-->
                <!--inputData-->
                <!--inputData-->
<!--                <p style="width: 100%;text-align: center;color: #333333;font-weight: bolder;font-size: 18px;margin-bottom: 10px;"-->
<!--                   v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">工具输入</p>-->
<!--                <p class="inputLine" v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">-->
<!--                  <span class="inputLineRound" @click="openInputTable" v-if="table_height_input === '0' "><span class="el-icon-d-arrow-right"></span></span>-->
<!--                  <span class="inputLineRound" @click="openInputTable" v-if="table_height_input === '461px' "><span class="el-icon-d-arrow-left"></span></span>-->
<!--                </p>-->
                <el-table
                  :data="currentNodeItem.inputData"
                  v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1"
                  :height="table_height_input"
                  :row-class-name="'needPointerCss'"
                  @row-click="viewCurrentNodeItemData($event,'input')"
                  :header-cell-style="{ textAlign: 'center' }">
                  <el-table-column label="文件名称" align="center" prop="key">
                    <!--                  <template slot-scope="scope">-->
                    <!--                    <el-popover trigger="hover" placement="left" v-if="scope.row.dataFields.length">-->
                    <!--                      <el-table :data="scope.row.dataFields"-->
                    <!--                                v-if="scope.row.dataFields.length"-->
                    <!--                                height="300px"-->
                    <!--                                :header-cell-style="{ textAlign: 'center' }">-->
                    <!--                        <el-table-column label="字段名称" align="center" prop="name">-->
                    <!--                        </el-table-column>-->
                    <!--                        <el-table-column label="描述" align="center" prop="describe">-->
                    <!--                        </el-table-column>-->
                    <!--                        <el-table-column label="类型" align="center" prop="type" width="80">-->
                    <!--                        </el-table-column>-->
                    <!--                      </el-table>-->
                    <!--                      <div slot="reference" class="name-wrapper">-->
                    <!--&lt;!&ndash;                        <el-tag size="medium"></el-tag>&ndash;&gt;-->
                    <!--                        {{ scope.row.key }}-->
                    <!--                      </div>-->
                    <!--                    </el-popover>-->
                    <!--                    <div slot="reference" class="name-wrapper" v-else>{{ scope.row.key }}</div>-->
                    <!--                  </template>-->
                  </el-table-column>
                  <!-- <el-table-column label="类型" align="center" prop="type" width="80">
                  </el-table-column> -->
<!--                  <el-table-column label="单位" align="center" prop="measure"></el-table-column>-->
                  <el-table-column label="描述" align="center" prop="description">
                  </el-table-column>
                </el-table>

                <!--outputData-->
                <!--outputData-->
                <!--outputData-->
<!--                <p style="width: 100%;text-align: center;color: #333333;font-weight: bolder;font-size: 18px;margin-top: 15px;margin-bottom: 10px;"-->
<!--                   v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">工具输出</p>-->
<!--                <p class="outputLine" v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">-->
<!--                  <span class="outputLineRound" @click="openOutputTable" v-if="table_height_output === '0' "><span class="el-icon-d-arrow-right"></span></span>-->
<!--                  <span class="outputLineRound" @click="openOutputTable" v-if="table_height_output === '461px' "><span class="el-icon-d-arrow-left"></span></span>-->
<!--                </p>-->
<!--                <el-table-->
<!--                  :data="currentNodeItem.outputData"-->
<!--                  v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1"-->
<!--                  :height="table_height_output"-->
<!--                  :row-class-name="'needPointerCss'"-->
<!--                  style="margin-top: 10px"-->
<!--                  @row-click="viewCurrentNodeItemData($event,'output')"-->
<!--                  :header-cell-style="{ textAlign: 'center' }">-->
<!--                  <el-table-column label="文件名称" align="center" prop="key">-->
<!--                    &lt;!&ndash;                  <template slot-scope="scope">&ndash;&gt;-->
<!--                    &lt;!&ndash;                    <el-popover trigger="hover" placement="left" v-if="scope.row.dataFields.length">&ndash;&gt;-->
<!--                    &lt;!&ndash;                      <el-table :data="scope.row.dataFields"&ndash;&gt;-->
<!--                    &lt;!&ndash;                                v-if="scope.row.dataFields.length"&ndash;&gt;-->
<!--                    &lt;!&ndash;                                height="300px"&ndash;&gt;-->
<!--                    &lt;!&ndash;                                :header-cell-style="{ textAlign: 'center' }">&ndash;&gt;-->
<!--                    &lt;!&ndash;                        <el-table-column label="字段名称" align="center" prop="name">&ndash;&gt;-->
<!--                    &lt;!&ndash;                        </el-table-column>&ndash;&gt;-->
<!--                    &lt;!&ndash;                        <el-table-column label="描述" align="center" prop="describe">&ndash;&gt;-->
<!--                    &lt;!&ndash;                        </el-table-column>&ndash;&gt;-->
<!--                    &lt;!&ndash;                        <el-table-column label="类型" align="center" prop="type" width="80">&ndash;&gt;-->
<!--                    &lt;!&ndash;                        </el-table-column>&ndash;&gt;-->
<!--                    &lt;!&ndash;                      </el-table>&ndash;&gt;-->
<!--                    &lt;!&ndash;                      <div slot="reference" class="name-wrapper">&ndash;&gt;-->
<!--                    &lt;!&ndash;                        &lt;!&ndash;                        <el-tag size="medium"></el-tag>&ndash;&gt;&ndash;&gt;-->
<!--                    &lt;!&ndash;                        {{ scope.row.key }}&ndash;&gt;-->
<!--                    &lt;!&ndash;                      </div>&ndash;&gt;-->
<!--                    &lt;!&ndash;                    </el-popover>&ndash;&gt;-->

<!--                    &lt;!&ndash;                    <div slot="reference" class="name-wrapper" v-else>{{ scope.row.key }}</div>&ndash;&gt;-->
<!--                    &lt;!&ndash;                  </template>&ndash;&gt;-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                <el-table-column label="类型" align="center" prop="type" width="80">&ndash;&gt;-->
<!--                  &lt;!&ndash;                </el-table-column>&ndash;&gt;-->
<!--                  <el-table-column label="描述" align="center" prop="description">-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                v-if="canDownloadNameList.length"&ndash;&gt;-->
<!--                  &lt;!&ndash;                this.$route.path === '/home/projectTwo&ndash;&gt;-->
<!--                  &lt;!&ndash; v-if="canDownloadNameList.length && $route.path === '/home/projectTwo' "-->
<!--                  v-if="canDownloadNameList.indexOf(scope.row.key) >= 0" &ndash;&gt;-->
<!--                  <el-table-column label="操作" align="center" prop="icon" v-if="$route.path === '/home/projectTwo'">-->
<!--                    <template slot-scope="scope">-->
<!--                    <span class="outDownloadCss"-->
<!--                          @click.stop="downloadOutFileFunc(scope.row,'isOutputDownload')"-->
<!--                    >下载</span>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                </el-table>-->



<!--                <p style="width: 100%;text-align: center;color: #333333;font-weight: bolder;font-size: 18px;margin-top: 15px;margin-bottom: 10px;"-->
<!--                   v-if="$route.path === '/home/projectTwo' && currentNodeItem.targetAlgorithm.indexOf('.file.Parse') >= 0 && $store.state.project.flowData.currentNodeItem['fileOutAfterRunList']">文件输出</p>-->

<!--                &lt;!&ndash;              :data="fileOutAfterRunList"&ndash;&gt;-->
<!--                <el-table-->

<!--                  :data="$store.state.project.flowData.currentNodeItem['fileOutAfterRunList'] || []"-->
<!--                  v-if="$route.path === '/home/projectTwo' && currentNodeItem.targetAlgorithm.indexOf('.file.Parse') >= 0 && $store.state.project.flowData.currentNodeItem['fileOutAfterRunList']"-->
<!--                  :height="461"-->
<!--                  :row-class-name="'needPointerCss'"-->
<!--                  style="margin-top: 10px"-->
<!--                  @row-click="viewCurrentNodeItemData($event,'文件输出')"-->
<!--                  :header-cell-style="{ textAlign: 'center' }">-->
<!--                  <el-table-column label="文件名称" align="center" prop="key">-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                <el-table-column label="类型" align="center" prop="type" width="80">&ndash;&gt;-->
<!--                  &lt;!&ndash;                </el-table-column>&ndash;&gt;-->
<!--                  <el-table-column label="描述" align="center" prop="description">-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                v-if="canDownloadNameList.length"&ndash;&gt;-->
<!--                  &lt;!&ndash;                this.$route.path === '/home/projectTwo&ndash;&gt;-->
<!--                  &lt;!&ndash; v-if="canDownloadNameList.length && $route.path === '/home/projectTwo' "-->
<!--                  v-if="canDownloadNameList.indexOf(scope.row.key) >= 0" &ndash;&gt;-->
<!--                  <el-table-column label="操作" align="center" prop="icon" v-if="$route.path === '/home/projectTwo'">-->
<!--                    <template slot-scope="scope">-->
<!--                    <span class="outDownloadCss"-->
<!--                          @click.stop="downloadOutFileFunc(scope.row,'fileOutAfterRun')"-->
<!--                    >下载</span>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                </el-table>-->

                <!--              fileOutAfterRunList-->

              </div>
            </el-scrollbar>
          </div>

        </el-collapse-item>


<!--        v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1"-->
        <el-collapse-item :name="5"
            v-if="currentNodeItem.targetAlgorithm !== 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse' && currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">
          <template slot="title"> 工具输出 </template>

          <div style="max-height: 745px; overflow: auto; background: #fff">
            <el-scrollbar style="height: 100%">
              <!-- <template slot="title">
             文件目录
            </template> -->
              <div class="" style="padding: 5px 10px 0 0">
                <el-form @submit.native.prevent>
                  <template>
                    <el-form-item>
                    </el-form-item>
                  </template>
                </el-form>
                <el-table
                  v-if="this.tableData.length > 0"
                  :data="tableData"
                  height="180px"
                  :header-cell-style="{ textAlign: 'center' }">
                  <el-table-column label="字段名称" align="center" prop="field">
                    <!-- <template slot-scope="scope">
                      {{ scope.row.field}}
                   </template> -->
                  </el-table-column>
                  <el-table-column label="类型" align="center" prop="fieldType">
                    <!-- <template slot-scope="scope">
                      {{ scope.row.fieldType}}
                   </template> -->
                  </el-table-column>
                  <el-table-column label="描述" align="center">
                    <template slot-scope="scope"> </template>
                  </el-table-column>
                </el-table>

                <!--inputData-->
                <!--inputData-->
                <!--inputData-->
<!--                <p style="width: 100%;text-align: center;color: #333333;font-weight: bolder;font-size: 18px;margin-bottom: 10px;"-->
<!--                   v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">工具输入</p>-->
<!--                <p class="inputLine" v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">-->
<!--                  <span class="inputLineRound" @click="openInputTable" v-if="table_height_input === '0' "><span class="el-icon-d-arrow-right"></span></span>-->
<!--                  <span class="inputLineRound" @click="openInputTable" v-if="table_height_input === '461px' "><span class="el-icon-d-arrow-left"></span></span>-->
<!--                </p>-->
<!--                <el-table-->
<!--                  :data="currentNodeItem.inputData"-->
<!--                  v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1"-->
<!--                  :height="table_height_input"-->
<!--                  :row-class-name="'needPointerCss'"-->
<!--                  @row-click="viewCurrentNodeItemData($event,'input')"-->
<!--                  :header-cell-style="{ textAlign: 'center' }">-->
<!--                  <el-table-column label="文件名称" align="center" prop="key">-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash; <el-table-column label="类型" align="center" prop="type" width="80">-->
<!--                  </el-table-column> &ndash;&gt;-->
<!--                  <el-table-column label="描述" align="center" prop="description">-->
<!--                  </el-table-column>-->
<!--                </el-table>-->

                <!--outputData-->
                <!--outputData-->
                <!--outputData-->
<!--                <p style="width: 100%;text-align: center;color: #333333;font-weight: bolder;font-size: 18px;margin-top: 15px;margin-bottom: 10px;"-->
<!--                   v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">工具输出</p>-->
<!--                <p class="outputLine" v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1">-->
<!--                  <span class="outputLineRound" @click="openOutputTable" v-if="table_height_output === '0' "><span class="el-icon-d-arrow-right"></span></span>-->
<!--                  <span class="outputLineRound" @click="openOutputTable" v-if="table_height_output === '461px' "><span class="el-icon-d-arrow-left"></span></span>-->
<!--                </p>-->
                <el-table
                  :data="currentNodeItem.outputData"
                  v-if="currentNodeItem.targetAlgorithm.indexOf('Transfer') !== -1"
                  :height="table_height_output"
                  :row-class-name="'needPointerCss'"
                  style="margin-top: 10px"
                  @row-click="viewCurrentNodeItemData($event,'output')"
                  :header-cell-style="{ textAlign: 'center' }">
                  <el-table-column label="文件名称" align="center" prop="key">
                    <!--                  <template slot-scope="scope">-->
                    <!--                    <el-popover trigger="hover" placement="left" v-if="scope.row.dataFields.length">-->
                    <!--                      <el-table :data="scope.row.dataFields"-->
                    <!--                                v-if="scope.row.dataFields.length"-->
                    <!--                                height="300px"-->
                    <!--                                :header-cell-style="{ textAlign: 'center' }">-->
                    <!--                        <el-table-column label="字段名称" align="center" prop="name">-->
                    <!--                        </el-table-column>-->
                    <!--                        <el-table-column label="描述" align="center" prop="describe">-->
                    <!--                        </el-table-column>-->
                    <!--                        <el-table-column label="类型" align="center" prop="type" width="80">-->
                    <!--                        </el-table-column>-->
                    <!--                      </el-table>-->
                    <!--                      <div slot="reference" class="name-wrapper">-->
                    <!--                        &lt;!&ndash;                        <el-tag size="medium"></el-tag>&ndash;&gt;-->
                    <!--                        {{ scope.row.key }}-->
                    <!--                      </div>-->
                    <!--                    </el-popover>-->

                    <!--                    <div slot="reference" class="name-wrapper" v-else>{{ scope.row.key }}</div>-->
                    <!--                  </template>-->
                  </el-table-column>
                  <!--                <el-table-column label="类型" align="center" prop="type" width="80">-->
                  <!--                </el-table-column>-->
<!--                  <el-table-column label="单位" align="center" prop="measure"></el-table-column>-->
                  <el-table-column label="描述" align="center" prop="description">
                  </el-table-column>
                  <!--                v-if="canDownloadNameList.length"-->
                  <!--                this.$route.path === '/home/projectTwo-->
                  <!-- v-if="canDownloadNameList.length && $route.path === '/home/projectTwo' "
                  v-if="canDownloadNameList.indexOf(scope.row.key) >= 0" -->
                  <el-table-column label="操作" align="center" prop="icon" v-if="$route.path === '/home/projectTwo'">
                    <template slot-scope="scope">
                    <span class="outDownloadCss"
                          @click.stop="downloadOutFileFunc(scope.row,'isOutputDownload')"
                    >下载</span>
                    </template>
                  </el-table-column>
                </el-table>



                <p style="width: 100%;text-align: center;color: #333333;font-weight: bolder;font-size: 18px;margin-top: 15px;margin-bottom: 10px;"
                   v-if="$route.path === '/home/projectTwo' && currentNodeItem.targetAlgorithm.indexOf('.file.Parse') >= 0 && $store.state.project.flowData.currentNodeItem['fileOutAfterRunList']">文件输出</p>

                <!--              :data="fileOutAfterRunList"-->
                <el-table

                  :data="$store.state.project.flowData.currentNodeItem['fileOutAfterRunList'] || []"
                  v-if="$route.path === '/home/projectTwo' && currentNodeItem.targetAlgorithm.indexOf('.file.Parse') >= 0 && $store.state.project.flowData.currentNodeItem['fileOutAfterRunList']"
                  :height="461"
                  :row-class-name="'needPointerCss'"
                  style="margin-top: 10px"
                  @row-click="viewCurrentNodeItemData($event,'文件输出')"
                  :header-cell-style="{ textAlign: 'center' }">
                  <el-table-column label="文件名称" align="center" prop="key">
                  </el-table-column>
                  <!--                <el-table-column label="类型" align="center" prop="type" width="80">-->
                  <!--                </el-table-column>-->
                  <el-table-column label="描述" align="center" prop="description">
                  </el-table-column>
                  <!--                v-if="canDownloadNameList.length"-->
                  <!--                this.$route.path === '/home/projectTwo-->
                  <!-- v-if="canDownloadNameList.length && $route.path === '/home/projectTwo' "
                  v-if="canDownloadNameList.indexOf(scope.row.key) >= 0" -->
                  <el-table-column label="操作" align="center" prop="icon" v-if="$route.path === '/home/projectTwo'">
                    <template slot-scope="scope">
                    <span class="outDownloadCss"
                          @click.stop="downloadOutFileFunc(scope.row,'fileOutAfterRun')"
                    >下载</span>
                    </template>
                  </el-table-column>
                </el-table>

                <!--              fileOutAfterRunList-->

              </div>
            </el-scrollbar>
          </div>

        </el-collapse-item>





<!--输入节点定义-->
<!--输入节点定义-->
<!--输入节点定义-->
<!--输入节点定义-->
        <el-collapse-item :name="6" v-if="currentNodeItem.targetAlgorithm === 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
          <template slot="title"> 输入节点定义 </template>
          <div style="padding: 8px;margin-top: 10px" v-if="currentNodeItem.targetAlgorithm === 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
            <!--        && $route.path == '/home/project'-->

            <!--      <div style="padding: 8px;margin-top: 10px" >-->
            <!--        <h2>节点定义</h2>-->
<!--            <p style="font-weight: bolder">节点定义</p><br/>-->
<!--            <p>输入节点：</p>-->
            <el-button type="primary" plain size="mini" style="margin: 10px 0" @click="addNewSingleNodeInput" v-show="$route.path == '/home/project'">新增</el-button>
<!--            <el-button type="primary" size="mini" style="margin: 10px 0" @click="addNewNodes('input')" v-show="$route.path == '/home/project'">新增输入节点</el-button>-->
            <el-table
              :data="this.$store.state.project.flowData.currentNodeItem.inputs"
              height="680px"
              @row-click="reviewFileChangeData($event,'input')"
              :header-cell-style="{ textAlign: 'center' }">
<!--              <el-table-column label="文件名" align="center" prop="key">-->
              <el-table-column label="输入接口" align="center" prop="key">
              </el-table-column>
<!--              <el-table-column label="类型" align="center" prop="type">-->
<!--              </el-table-column>-->
<!--              <el-table-column label="描述" prop="description" align="center"></el-table-column>-->
              <el-table-column label=" " prop="key" align="center" width="60">
                <template slot-scope="scope">
                  <span style="cursor: pointer;display:inline-block;padding: 10px;" @click.stop="deleteSingleNode(scope.row,scope.$index,'input')"><i class="el-icon-close" style="color: red"></i></span>
                </template>
              </el-table-column>
            </el-table>

<!--            <p style="margin-top: 10px;">输出节点：</p>-->
<!--            <el-button type="primary" size="mini" style="margin: 10px 0" @click="addNewNodes('output')" v-show="$route.path == '/home/project'">新增输出节点</el-button>-->
<!--            <el-table-->
<!--              :data="this.$store.state.project.flowData.currentNodeItem.outputs"-->
<!--              height="240px"-->
<!--              @row-click="reviewFileChangeData($event,'output')"-->
<!--              :header-cell-style="{ textAlign: 'center' }">-->
<!--              <el-table-column label="文件名" align="center" prop="key">-->
<!--              </el-table-column>-->
<!--              <el-table-column label="类型" align="center" prop="type">-->
<!--              </el-table-column>-->
<!--              <el-table-column label="描述" prop="description" align="center"></el-table-column>-->
<!--            </el-table>-->
          </div>
        </el-collapse-item>




<!--输出节点定义-->
<!--输出节点定义-->
<!--输出节点定义-->
<!--输出节点定义-->
        <el-collapse-item :name="7" v-if="currentNodeItem.targetAlgorithm === 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
          <template slot="title"> 输出节点定义 </template>
          <div style="padding: 8px;margin-top: 10px" v-if="currentNodeItem.targetAlgorithm === 'com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse'">
            <!--        && $route.path == '/home/project'-->

            <!--      <div style="padding: 8px;margin-top: 10px" >-->
            <!--        <h2>节点定义</h2>-->
            <!--            <p style="font-weight: bolder">节点定义</p><br/>-->
<!--            <p>输入节点：</p>-->
<!--            <el-button type="primary" size="mini" style="margin: 10px 0" @click="addNewNodes('input')" v-show="$route.path == '/home/project'">新增输入节点</el-button>-->
<!--            <el-table-->
<!--              :data="this.$store.state.project.flowData.currentNodeItem.inputs"-->
<!--              height="240px"-->
<!--              @row-click="reviewFileChangeData($event,'input')"-->
<!--              :header-cell-style="{ textAlign: 'center' }">-->
<!--              <el-table-column label="文件名" align="center" prop="key">-->
<!--              </el-table-column>-->
<!--              <el-table-column label="类型" align="center" prop="type">-->
<!--              </el-table-column>-->
<!--              <el-table-column label="描述" prop="description" align="center"></el-table-column>-->
<!--            </el-table>-->

<!--            <p style="margin-top: 10px;">输出节点：</p>-->
            <el-button type="primary" size="mini" style="margin: 10px 0" @click="addNewNodes('output')" v-show="$route.path == '/home/project'">新增输出节点</el-button>
            <el-table
              :data="this.$store.state.project.flowData.currentNodeItem.outputs"
              height="680px"
              @row-click="reviewFileChangeData($event,'output')"
              :header-cell-style="{ textAlign: 'center' }">
              <el-table-column label="文件名" align="center" prop="key">
              </el-table-column>
              <el-table-column label="类型" align="center" prop="type">
              </el-table-column>
              <el-table-column label="描述" prop="description" align="center"></el-table-column>
              <el-table-column label=" " prop="key" align="center" width="60">
                <template slot-scope="scope">
                  <span style="cursor: pointer;display:inline-block;padding: 10px;" @click.stop="deleteSingleNode(scope.row,scope.$index,'output')"><i class="el-icon-close" style="color: red"></i></span>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-collapse-item>
      </el-collapse>






<!--      <el-dialog :title="'节点编辑'"-->
<!--                 :visible.sync="showNodeEditDialog"-->
<!--                 align="center">-->
<!--        <el-form :model="nodeEditItem" :rules="rules2" ref="editItem" label-width="7em"-->
<!--                 style="height:500px;overflow-y: auto;padding-right:10px;">-->
<!--          <el-form-item label="key" prop="key">-->
<!--            <el-input v-model="nodeEditItem.key" placeholder="请输入节点的key" maxlength="25"></el-input>-->
<!--          </el-form-item>-->
<!--&lt;!&ndash;          <el-form-item label="输入类别" align="left">&ndash;&gt;-->
<!--&lt;!&ndash;            <el-select v-model="editItem.cat" style="width: 100%">&ndash;&gt;-->
<!--&lt;!&ndash;              <el-option&ndash;&gt;-->
<!--&lt;!&ndash;                v-for="item in options"&ndash;&gt;-->
<!--&lt;!&ndash;                :key="item.value"&ndash;&gt;-->
<!--&lt;!&ndash;                :label="item.label"&ndash;&gt;-->
<!--&lt;!&ndash;                :value="item.value">&ndash;&gt;-->
<!--&lt;!&ndash;              </el-option>&ndash;&gt;-->
<!--&lt;!&ndash;            </el-select>&ndash;&gt;-->
<!--&lt;!&ndash;          </el-form-item>&ndash;&gt;-->

<!--          <el-form-item label="字段配置"  align="left" style="margin: 20px 0">-->
<!--            <el-row :gutter="2">-->
<!--              &lt;!&ndash;          <el-col :span="22">&ndash;&gt;-->
<!--              &lt;!&ndash;            <el-radio-group v-model="editItem.access">&ndash;&gt;-->
<!--              &lt;!&ndash;              <el-radio label="SAME">与输入一致</el-radio>&ndash;&gt;-->
<!--              &lt;!&ndash;              <el-radio label="APPEND">在输出集追加</el-radio>&ndash;&gt;-->
<!--              &lt;!&ndash;              <el-radio label="UNKNOWN">未知</el-radio>&ndash;&gt;-->
<!--              &lt;!&ndash;            </el-radio-group>&ndash;&gt;-->
<!--              &lt;!&ndash;          </el-col>&ndash;&gt;-->
<!--              <template>-->
<!--                <el-col :span="7" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">-->
<!--                  字段名-->
<!--                </el-col>-->
<!--                <el-col :span="7" style="background-color: rgba(0,0,0,0.05)">-->
<!--                  描述-->
<!--                </el-col>-->
<!--                <el-col :span="7" style="background-color: rgba(0,0,0,0.05)">-->
<!--                  类型-->
<!--                </el-col>-->
<!--                <el-col :span="2" style="background-color: rgba(0,0,0,0.05)">-->
<!--&lt;!&ndash;                  <i class="fa fa-plus-square-o" title="添加字段" @click="addNewFieldsFunc(showNodeEditDialogType)" style="cursor: pointer"></i>&ndash;&gt;-->
<!--                </el-col>-->


<!--                <template v-for="(item,index) in addFields">-->
<!--                  <el-col :span="8" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">-->
<!--                    <el-input v-model="item.name" placeholder="请输入字段名称" size="small"></el-input>-->
<!--                  </el-col>-->

<!--                  <el-col :span="7" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">-->
<!--&lt;!&ndash;                    <el-input v-model="item.description" placeholder="请输入描述" size="small"></el-input>&ndash;&gt;-->
<!--                    <el-input v-model="item.describe" placeholder="请输入描述" size="small"></el-input>-->
<!--                  </el-col>-->

<!--                  <el-col :span="7" style="background-color: rgba(0,0,0,0.05)">-->
<!--                    <el-select v-model="item.type" size="small">-->
<!--                      <el-option-->
<!--                        v-for="item in newDataType"-->
<!--                        :label="item.label"-->
<!--                        :key="item.value"-->
<!--                        :value="item.value">-->
<!--                      </el-option>-->
<!--                    </el-select>-->
<!--                  </el-col>-->
<!--                  <el-col :span="2" style="background-color: rgba(0,0,0,0.05)">-->
<!--                    <i class="fa fa-trash-o" @click="addFields.splice(index,1)"></i>-->
<!--                  </el-col>-->
<!--                </template>-->
<!--              </template>-->
<!--            </el-row>-->
<!--          </el-form-item>-->

<!--          <el-form-item label="描述" prop="description">-->
<!--            <el-input type="textarea" placeholder="请输入节点的描述" v-model.trim="nodeEditItem.description"></el-input>-->
<!--          </el-form-item>-->
<!--        </el-form>-->
<!--        <span slot="footer" class="dialog-footer">-->
<!--          <el-button type="primary" @click="newNodeAddConfirm(showNodeEditDialogType)">确 认</el-button>-->
<!--          <el-button @click="cancelAddNode">取 消</el-button>-->
<!--        </span>-->
<!--      </el-dialog>-->


      <!-- <el-collapse class="projectPropsParameter" accordion :value="currentNodeItem.tabs.length>0?currentNodeItem.tabs[0].id:''">
      <el-collapse-item v-for="tabItem in currentNodeItem.tabs" :title="tabItem.tabName" :name="tabItem.id" :key="tabItem.id">
        <div class="contentStyle">
            <template v-for="(element,index) in tabItem.elements">
              <PropItem :item="element" :index="index" :nodeItem="currentNodeItem"></PropItem>
            </template>
        </div>
      </el-collapse-item>
    </el-collapse> -->

<!--      :before-close="closeAddDialog"-->
      <el-dialog
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        :modal="true"
        :title="''"
        class="mergeOutDialog"
        :visible="compMergeDialogVisible"
        width="850px">
        <div class="compMergeClass">
<!--          <p class="compTitle" v-if="!nodeDialogIsReview">{{selectValue === 'keyAdd' ? (showNodeEditDialogType === 'input' ? '新增输入节点编辑' : '新增输入节点编辑') : '组件合并'}}</p>-->
<!--          <p class="compTitle" v-if="nodeDialogIsReview">{{showNodeEditDialogType === 'input' ? '输入节点预览' : '输出节点预览'}}</p>-->
          <p class="compTitle">组件合并</p>
          <div style="margin-right: 12px;">
            <el-form>
<!--              <el-form-item label="key" v-if="selectValue === 'keyAdd'" style="margin-left: 8px">-->
<!--                <el-input v-model="nodeEditItem.key" :disabled="nodeDialogIsReview" placeholder="请输入节点的key" maxlength="25" style="width: 300px;"></el-input>-->
<!--              </el-form-item>-->

<!--              <el-form-item label="描述" v-if="selectValue === 'keyAdd'" style="margin: 10px 0">-->
<!--                <el-input type="text" placeholder="请输入节点的描述" :disabled="nodeDialogIsReview" v-model.trim="nodeEditItem.description" style="width: 300px;"></el-input>-->
<!--              </el-form-item>-->

<!--              <p style="font-weight: bolder;font-size: 16px" v-if="selectValue === 'keyAdd' && !nodeDialogIsReview">选择字段</p>-->

              <el-tree v-if="(selectValue == 'selectionParam' || selectValue == 'keyAdd') && $route.path == '/home/project' && !nodeDialogIsReview"
                   style="margin-top: 10px"
                   :data="dataSource"
                   show-checkbox
                   @check="handleCheckFunc"
                   @check-change="handleCheckChange"
                   :check-strictly="false"
                   class="dialogTree"
                   :props="{label: 'fileName',children: 'sourcePortId'}"
                   node-key="id">
              </el-tree>
              <el-table v-if="(selectValue == 'selectionParam' || selectValue == 'keyAdd') && $route.path == '/home/project' && !nodeDialogIsReview "
                        border
                        @cell-dblclick="cellDblclick"
                        :data="itemTree"
                        ref="newFieldsRefMerge"
                        row-key="oldId"
                        @selection-change="handleSelectionChange($event)"
                        style="width: 100%; margin-top: 20px"
                        :header-cell-style="{ background: '#f5f7fa', color: '#606266' }">
                <el-table-column type="selection" width="55"> </el-table-column>
                <el-table-column label="字段名称" align="center" prop="name"></el-table-column>
                <el-table-column label="描述" align="center" prop="describe"></el-table-column>
                <el-table-column label="类型" align="center" prop="type"></el-table-column>
                <el-table-column prop="asColumn" label="别名" align="center">
                  <template slot-scope="scope">
                    <span v-if="!scope.row.isRename">{{scope.row.asColumn}}</span>
                    <el-input
                      v-else
                      size="mini"
                      ref="inputVal"
                      v-model="scope.row.asColumn"
                      @blur="cellOnBlur(scope.row)"></el-input>
                  </template>
                </el-table-column>
              </el-table>

              <el-form-item label="字段"  align="left" v-if="nodeDialogIsReview" style="margin-bottom: 20px">
                <el-row :gutter="24" v-if="nodeDialogIsReview" style="margin-left: 40px;">
                  <template>
                    <br/>
                    <el-col :span="8" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">
                      字段名
                    </el-col>
                    <el-col :span="7" style="background-color: rgba(0,0,0,0.05)">
                      描述
                    </el-col>
                    <el-col :span="5" style="background-color: rgba(0,0,0,0.05)">
                      类型
                    </el-col>
                    <el-col :span="2" style="background-color: rgba(0,0,0,0.05)">
<!--                      <i class="fa fa-plus-square-o" title="添加字段" @click="addFields.push({name:'',type:'String'})" style="cursor: pointer"></i>-->
                    </el-col>

                    <template v-for="(item,index) in reviewFieldsList">
                      <el-col :span="8" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">
                        <el-input v-model="item.name" placeholder="请输入字段名称" size="small" disabled></el-input>
                      </el-col>
                      <el-col :span="7" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">
                        <el-input v-model="item.describe" placeholder="请输入描述" size="small" disabled></el-input>
                      </el-col>
                      <el-col :span="5" style="background-color: rgba(0,0,0,0.05)">
                        <el-select v-model="item.type" size="small" disabled>
                          <el-option
                            disabled
                            v-for="item in newDataType"
                            :label="item.label"
                            :key="item.value"
                            :value="item.value">
                          </el-option>
                        </el-select>
                      </el-col>
                      <el-col :span="2" style="background-color: rgba(0,0,0,0.05)">
<!--                        <i class="fa fa-trash-o" @click="addFields.splice(index,1)"></i>-->
                      </el-col>
                    </template>

                    <template v-if="!reviewFieldsList.length">

                      <el-col :span="20" style="text-align: center">暂无数据</el-col>
                    </template>
                  </template>
                </el-row>
              </el-form-item>


              <div style="width: 100%;text-align: center" v-if="selectValue == 'selectionParam' && $route.path == '/home/project'">
                <el-button
                  type="primary"
                  @click="setArrayStorageFun"
                  size="mini"
                  style="width: 30%; margin:20px auto 0 auto"
                  v-if="selectValue == 'selectionParam' && $route.path == '/home/project'">确定选中</el-button>
              </div>
              <el-table :data="selDataArray"
                        v-if="selectValue == 'selectionParam' &&$route.path == '/home/project'"
                        style="width: 100%; margin-top: 20px"
                        :header-cell-style="{ background: '#f5f7fa', color: '#606266' }">
                <el-table-column label="字段名称" align="center" prop="name"></el-table-column>
                <el-table-column label="别名" align="center" prop="asColumn" ></el-table-column>
                <el-table-column label="描述" align="center" prop="describe"></el-table-column>
                <el-table-column label="类型" align="center" prop="type"></el-table-column>
                <el-table-column label="操作" align="center" prop="type">
                  <template slot-scope="scope">
                    <i class="el-icon-close" style="font-size: 16px;color: red;cursor: pointer" @click="deleteThisChecked(scope.row)"></i>
                  </template>
                </el-table-column>
              </el-table>
              <el-form-item
                label="是否合并:"
                style="margin-top: 10px"
                v-if="selectValue == 'selectionParam' && $route.path == '/home/project'">
                <el-radio v-model="concat" :label="true">是</el-radio>
                <el-radio v-model="concat" :label="false">否</el-radio>
              </el-form-item>
              <el-form-item
                label="合并文件:"
                v-if="concat == true && selectValue == 'selectionParam' &&$route.path == '/home/project'">
                <el-input v-model="concatFilePath" size="mini"></el-input>
              </el-form-item>
              <div v-if="concat == false && selectValue == 'selectionParam' && $route.path == '/home/project' ">
                <div v-for="(item,index) in fileNumClass" :key="item.fileName">
                  <!--                  <el-form-item :label="item.fileName+'原地址：'" label-width="120px">-->
                  <el-form-item :label="'原地址：'" label-width="120px">
                    <el-input size="mini" placeholder="请输入原文件地址" v-model="fileNumClass[index].originalFileAddress" style="width:63%;"></el-input>
                  </el-form-item>
                  <!--                    <el-form-item :label="item.fileName+'新地址：'" label-width="120px">-->
                  <el-form-item :label=" '新地址：'" label-width="120px">
                    <el-input size="mini" placeholder="请输入新文件地址" v-model="fileNumClass[index].newFileAddress"  style="width:63%;"></el-input>
                  </el-form-item>
                </div>
              </div>
            <div style="width: 100%;text-align: center">
              <el-button type="danger" size="small" @click="closeMergeDialog">关闭</el-button>
              <el-button type="primary"
                         @click="confirm"
                         size="small"
                         style="margin-top: 20px"
                         v-if="selectValue == 'selectionParam' && $route.path == '/home/project' ">保存</el-button>
<!--              <el-button type="primary"-->
<!--                         @click="newNodeAddConfirm(showNodeEditDialogType)"-->
<!--                         size="small"-->
<!--                         style="margin-top: 20px"-->
<!--                         v-if="selectValue == 'keyAdd' && $route.path == '/home/project' && !nodeDialogIsReview">保存</el-button>-->
            </div>
            </el-form>
          </div>
        </div>
      </el-dialog>

      <el-dialog
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        :modal="true"
        :title="''"
        class="mergeOutDialog"
        :visible="addNodeDialog"
        width="850px">
        <div class="compMergeClass">
          <p class="compTitle" v-if="!nodeDialogIsReview">{{showNodeEditDialogType === 'input' ? '新增输入节点' : '新增输出节点'}}</p>
          <p class="compTitle" v-if="nodeDialogIsReview">{{showNodeEditDialogType === 'input' ? '输入节点预览' : '输出节点预览'}}</p>
          <div style="margin-right: 12px;">
            <el-form>

              <el-form-item label="文件名">
<!--                placeholder="请输入节点的key"-->
<!--                :disabled="nodeDialogIsReview"-->
                <el-input v-model="nodeEditItem.key" maxlength="25" style="width: 300px;"></el-input>
              </el-form-item>

              <el-form-item label="描述" style="margin: 20px 14px 10px 14px">
<!--                placeholder="请输入节点的描述"-->
<!--                :disabled="nodeDialogIsReview"-->
                <el-input type="text" v-model.trim="nodeEditItem.description" style="width: 300px;"></el-input>
              </el-form-item>

<!--              v-if="!nodeDialogIsReview"-->
              <p style="font-weight: bolder;font-size: 16px">选择字段</p>

<!--              && !nodeDialogIsReview-->
              <el-tree v-if="$route.path == '/home/project'"
                       style="margin-top: 10px"
                       :data="dataSource"
                       show-checkbox
                       @check="handleCheckFunc"
                       @check-change="handleCheckChange"
                       :check-strictly="false"
                       class="dialogTree"
                       ref="checkedElTreeRef"
                       :props="{label: 'fileName',children: 'sourcePortId'}"
                       node-key="id">
              </el-tree>
<!--              && !nodeDialogIsReview-->
<!--              :row-key="getRowKeys"-->
              <el-table v-if="$route.path == '/home/project' && addNodeDialog "
                        :key="addNodeDialog"
                        border
                        @cell-dblclick="cellDblclick"
                        :data="itemTree"
                        ref="newFieldsRef"
                        row-key="oldId"
                        @selection-change="handleSelectionChange($event)"
                        style="width: 100%; margin-top: 20px"
                        :header-cell-style="{ background: '#f5f7fa', color: '#606266' }">
                <el-table-column type="selection" width="55" :reserve-selection="true"> </el-table-column>
                <el-table-column label="字段名称" align="center" prop="name"></el-table-column>
                <el-table-column label="单位" align="center" prop="measure"></el-table-column>
                <el-table-column label="描述" align="center" prop="describe"></el-table-column>
                <el-table-column label="类型" align="center" prop="type"></el-table-column>
                <el-table-column prop="asColumn" label="别名" align="center">
                  <template slot-scope="scope">
                    <span v-if="!scope.row.isRename">{{scope.row.asColumn}}</span>
                    <el-input
                      v-else
                      size="mini"
                      ref="inputVal"
                      v-model="scope.row.asColumn"
                      @blur="cellOnBlur(scope.row)"></el-input>
                  </template>
                </el-table-column>
              </el-table>

<!--              <el-form-item label="字段"  align="left" v-if="nodeDialogIsReview" style="margin-bottom: 20px;margin-left: 14px">-->
<!--                <el-row :gutter="24" v-if="nodeDialogIsReview" style="margin-left: 40px;">-->
<!--                  <template>-->
<!--                    <br/>-->
<!--                    <el-col :span="8" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">字段名</el-col>-->
<!--                    <el-col :span="7" style="background-color: rgba(0,0,0,0.05)">描述</el-col>-->
<!--                    <el-col :span="5" style="background-color: rgba(0,0,0,0.05)">类型</el-col>-->
<!--                    <el-col :span="2" style="background-color: rgba(0,0,0,0.05)">-->
<!--                      &lt;!&ndash;                      <i class="fa fa-plus-square-o" title="添加字段" @click="addFields.push({name:'',type:'String'})" style="cursor: pointer"></i>&ndash;&gt;-->
<!--                    </el-col>-->

<!--                    <template v-for="(item,index) in reviewFieldsList">-->
<!--                      <el-col :span="8" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">-->
<!--                        <el-input v-model="item.name" placeholder="请输入字段名称" size="small" disabled></el-input>-->
<!--                      </el-col>-->
<!--                      <el-col :span="7" style="background-color: rgba(0,0,0,0.05);padding-left: 10px">-->
<!--                        <el-input v-model="item.describe" placeholder="请输入描述" size="small" disabled></el-input>-->
<!--                      </el-col>-->
<!--                      <el-col :span="5" style="background-color: rgba(0,0,0,0.05)">-->
<!--                        <el-select v-model="item.type" size="small" disabled>-->
<!--                          <el-option-->
<!--                            disabled-->
<!--                            v-for="item in newDataType"-->
<!--                            :label="item.label"-->
<!--                            :key="item.value"-->
<!--                            :value="item.value">-->
<!--                          </el-option>-->
<!--                        </el-select>-->
<!--                      </el-col>-->
<!--                      <el-col :span="2" style="background-color: rgba(0,0,0,0.05)">-->
<!--                        &lt;!&ndash;                        <i class="fa fa-trash-o" @click="addFields.splice(index,1)"></i>&ndash;&gt;-->
<!--                      </el-col>-->
<!--                    </template>-->
<!--                    <template v-if="!reviewFieldsList.length">-->
<!--                      <el-col :span="20" style="text-align: center">暂无数据</el-col>-->
<!--                    </template>-->
<!--                  </template>-->
<!--                </el-row>-->
<!--              </el-form-item>-->


              <div style="width: 100%;text-align: center">
                <el-button type="danger" size="small" @click="closeMergeDialog">关闭</el-button>
                <el-button type="primary"
                           @click="newNodeAddConfirm(showNodeEditDialogType)"
                           size="small"
                           style="margin-top: 20px"
                           v-if="$route.path == '/home/project' && !nodeDialogIsReview">保存</el-button>
                <el-button type="primary"
                           @click="nodeModifySave(showNodeEditDialogType)"
                           size="small"
                           style="margin-top: 20px"
                           v-if="$route.path == '/home/project' && nodeDialogIsReview">保存修改</el-button>
              </div>
            </el-form>
          </div>
        </div>
      </el-dialog>



      <el-dialog :close-on-click-modal="true"
                 :close-on-press-escape="false"
                 :modal="true"
                 :title="''"
                 class="mergeOutDialog"
                 :visible="viewFieldsVisible"
                 :before-close="closeViewFieldsDialog"
                 width="690px">
        <div class="innerFieldsCss">
          <p style="font-size: 20px;font-weight: bolder;margin: 6px 0 10px 0" v-if="isFileOutDialog">{{'文件输出'}}</p>
          <p style="font-size: 20px;font-weight: bolder;margin: 6px 0 10px 0" v-else>{{fieldsList.typeName === 'input' ? '输入文件' : '输出文件'}}</p>

          <p style="margin-bottom: 10px;" v-if="!isFileOutDialog">文件名称：<span style="display: inline-block;margin-right: 30px;">{{fieldsList.key}} </span>
            类型：<span style="display: inline-block;margin-right: 30px;">{{fieldsList.type}} </span> 描述：{{fieldsList.description}}</p>

          <el-button type="primary" size="small"
                     @click.stop="downloadOutFileFunc(fieldsList)"
                     v-if="fieldsList.typeName === 'output' && canDownloadNameList.indexOf(fieldsList.key) >= 0 ">下载文件</el-button>

<!--          //工具输入、工具输出 table-->
<!--          v-if="!isFileOutDialog"-->
          <el-table :data="fieldsList.dataFields"

                    height="380px"
                    :header-cell-style="{ textAlign: 'center' }">
            <el-table-column label="字段名称" align="center" prop="name">
            </el-table-column>
            <el-table-column label="单位" align="center" prop="measure">
              <template slot-scope="scope">
                <span>{{scope.row.measure || scope.row.Measure || ''}}</span>
              </template>
            </el-table-column>
            <el-table-column label="描述" align="center" prop="describe">
            </el-table-column>
            <el-table-column label="类型" align="center" prop="type">
            </el-table-column>
          </el-table>

<!--&lt;!&ndash;          //文件输出&ndash;&gt;-->
<!--          <el-table :data="fieldsList"-->
<!--                    v-if="isFileOutDialog"-->
<!--                    height="380px"-->
<!--                    :header-cell-style="{ textAlign: 'center' }">-->
<!--            <el-table-column label="字段名称" align="center" prop="name">-->
<!--            </el-table-column>-->
<!--            <el-table-column label="描述" align="center" prop="describe">-->
<!--            </el-table-column>-->
<!--            <el-table-column label="类型" align="center" prop="type">-->
<!--            </el-table-column>-->
<!--          </el-table>-->

        </div>
      </el-dialog>

      <div
        class="projectPropsDesc runBoxBtnCss"
        style="
          width: 240px;
          height: 46px;
          z-index: 999;
          display: flex;
          position: absolute;
          top:0;
          justify-content: space-around;
          align-items: center;
          padding-left: 10px;
          padding-right: 10px;"

        v-if="$route.path == '/home/projectTwo'"
        v-show="switchingVariable === true">
<!--        style="{ : (propsContentStyle.width - 45) + 'px' }"-->
<!--        :style="{ width: (propsContentStyle.width - 45) + 'px' }"-->
        <el-button type="primary" @click="implement" style="width: 58px" size="mini">执行</el-button>
<!--        <el-button type="primary" style="width: 50px" @click="finishes" size="mini">完成</el-button>-->
        <el-button type="primary" style="width: 58px" @click="finishes(false)" size="mini">提交</el-button>



        <el-button type="primary" style="width: 140px" @click="pushFileToMainFunc" size="mini">推送文件到数字主线</el-button>



        <!-- <el-collapse accordion v-model="activeName">
         <el-collapse-item :name="2">
          <template slot="title">
            组件属性
          </template>
          <div class="projectPropsDescText">{{currentNodeItem.description}}</div>
        </el-collapse-item>
      </el-collapse> -->
      </div>
<!--      <div style="margin-top: 20px">-->
<!--        <el-button-->
<!--          type="primary"-->
<!--          style="width: 100%"-->
<!--          @click="dialogVisible = true"-->
<!--          >WEBUI</el-button-->
<!--        >-->
<!--      </div>-->
      <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        width="30%"
        :before-close="handleClose">
        <el-input size="mini" v-model="$store.state.project.flowData.currentNodeItem.webUI"></el-input>
        <span slot="footer" class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        </span>
      </el-dialog>
    </el-scrollbar>
  </div>
</template>
<style>
.el-collapse-item__content {
  padding: 0px;
}
.el-table__expand-icon {
  display: inline-block;
}
.el-form-item {
  margin-bottom: 0;
}
tbody .el-table__row--level-0 {
  background: rgba(223, 217, 217, 0.5);
}
.el-table__header tr,
.el-table__header th {
  padding: 0;
  height: 42px;
}
.el-upload-dragger {
  width: 120%;
}
.el-upload-dragger {
  height: 150px;
}
.el-table .cell {
  line-height: 30px !important;
}

.compMergeClass {
  max-height: 820px;
  overflow-y: auto;
}

.compMergeClass .compTitle {
  font-size: 20px;
  margin-bottom: 20px;
}
.dialogTree .el-tree-node__label {
  font-size: 16px !important;
}

.mergeOutDialog .el-dialog__header {
  display: none;
}
.mergeOutDialog .el-dialog__body {
  border-radius: 6px;
}
.mergeOutDialog .el-dialog__body {
  padding: 15px 5px 25px 20px !important;
}
.needPointerCss {
  cursor: pointer;
}

.innerFieldsCss {
  height: 470px;
  overflow-y: auto;
  padding: 10px 15px 10px 5px;
}

.outDownloadCss {
  display: inline-block;
  /*background-color: red;*/
  font-weight: bolder;
  font-size: 16px;
  color: #409eff;
  padding: 0 20px;
}
.outDownloadCss:hover {
  text-decoration: underline;
}

.inputLine {
  /*width: 100%;*/
  /*height: 1px;*/
  /*background-color: #ebeef5;*/
  /*position: relative;*/
  /*margin-bottom: 10px;*/
  /*text-align: center;*/

  width: 100%;
  height: 1px;
  /*background-color: #aeaeae;*/
  border-top: 1px solid #ebeef5;
  position: relative;
  margin-bottom: 10px;
  padding-bottom: 3px;
  text-align: center;
}
.outputLine {
  width: 100%;
  height: 1px;
  /*background-color: #aeaeae;*/
  border-top: 1px solid #ebeef5;
  position: relative;
  margin-bottom: 10px;
  padding-bottom: 12px;
  text-align: center;
}

.inputLineRound,
.outputLineRound {
  position: absolute;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border: 1px solid #289de9;
  border-radius: 50%;
  /*margin: 0 auto;*/
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translate(-50%, 0);
  /*transform: rotate(90deg);*/
  background-color: #289de9;
  cursor: pointer;
}
.inputLineRound span,
.outputLineRound span {
  color: white;
  font-weight: bolder;
  transform: rotate(90deg);
}
</style>
<script>
import $ from "jquery";
import PropItem from "./project_props/PropItem.vue";
import store from "@/store";
import {
  directorySearch,
  getFileName,
  getOutputName,
  getSuperiorInfo,
  downLoadFile,
  getThisProjectAllTeamMember
} from "@/api/sourceDetail";
import Papa from "papaparse";
import jschardet from "jschardet";
import { mapGetters } from "vuex";
import {
  fileChangeWhenAutoRun,
  queryInstanceRunStatus,
  editOrAddInstanceRunStatus
} from "../../api/sourceDetail";

import staticConfigJson from "../../../static/config.json";

export default {
  name: "ProjectProps",
  data() {
    var validateKey = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入名称"));
      } else {
        if (this.editItem.key !== "") {
          var reg = /^\w.+$/; //数字、26个英文字母或者下划线组成的字符串
          if (!reg.test(value)) {
            callback(
              new Error("请使用数字、26个英文字母或者下划线组成的字符串")
            );
          }
          callback();
        }
        callback();
      }
    };
    return {
      fileNumClass: null,
      dialogVisible: false,
      pathXZ: "",
      setArrayStorage: [],
      selDataArray: [],
      itemTree: [],
      urlAction: "http://192.168.1.3:8088/dmserver/api/file/FileParseUpload",
      // store.state.global.httpServer + "/dmserver/api/file/FileParseUpload",
      defaultProps: {
        children: "children",
        label: "label"
      },
      dataSource: [],
      renameFile: {
        originalFileAddress: "",
        newFileAddress: ""
      },
      fileParse: [],
      concat: true,
      concatFilePath: "",
      fieldArray: [],
      fileList: [],
      selectValue: "",
      seletItem: [
        // {
        //   id: 1,
        //   name: "重命名",
        //   type: "rename"
        // },
        {
          id: 2,
          name: "选择合并",
          type: "selectionParam"
        }
      ],
      filePath: "D:workdir\\run_task_num_1",
      activeName: 1,
      fileDataList: [],
      tableData: [],
      multipleSelection: [],

      compMergeDialogVisible: false, // 组件合并dialog

      viewFieldsVisible: false, // 查看字段列表弹框
      fieldsList: {}, //字段列表数据

      checkedParentNameList: [], //合并字段选择的集合 id和name

      canDownloadNameList: [], // 输出文件 可下载项 集合
      table_height_input: "690px", //"0",
      table_height_output: "690px", //"0",

      compPersonLiable: [], //组建责任人
      thisProjectAllMember: [], //这个工程下所有团队协作人员

      // fileOutAfterRunList:[]
      isFileOutDialog: false, //是否文件输出弹框
      showNodeEditDialog: false,
      showNodeEditDialogType: "",
      nodeEditItem: {},
      rules2: {
        key: [
          // {validator: validateKey, trigger: 'blur'},
          { min: 1, max: 25, message: "长度在 1 到 25 个字符", trigger: "blur" }
        ],
        description: [
          { required: true, message: "请输入描述信息", trigger: "blur" },
          {
            min: 1,
            max: 300,
            message: "长度在 1 到 300 个字符",
            trigger: "blur"
          }
        ]
      },
      addFields: [],
      newDataType: [
        { label: "字符", value: "String" },
        { label: "数值", value: "Double" },
        { label: "时间", value: "timestamp" },
        { label: "日期", value: "date" }
      ],
      nodeDialogIsReview: false, //是否是节点预览
      reviewFieldsList: [],

      addNodeDialog: false
    };
  },
  watch: {
    selDataArray: {
      immediate: true,
      handler(val) {
        this.fileNumClass = this.fn2(val);
      }
    }
  },
  mounted() {
    this.reviewPersonLiable(); //回显组件责任人
    this.getAllTeamMemberData(); //获取团队下所有团队协作人员

    /*
    if(this.$route.path == '/home/projectTwo' && this.$route.query && this.$route.query.runId){ //确保是运行实例而不是调试运行
      this.getNodeStatus(this.$route.query.id.toString(),this.$route.query.runId.toString()) //获取节点状态
    }
    */
  },
  methods: {
    getRowKeys(row) {
      // console.log(row);
      // return row.key + row.describe + row.type
      return row.key + row.describe + row.type;
    },
    //回显组件责任人
    reviewPersonLiable() {
      if (
        this.$store.state.project.flowData.currentNodeItem &&
        this.$store.state.project.flowData.currentNodeItem.compPersonLiable
      ) {
        // console.log(this.$store.state.project.flowData.currentNodeItem);
        this.compPersonLiable = this.$store.state.project.flowData.currentNodeItem.compPersonLiable.split(
          ","
        );
      }
    },

    //选择组建责任人
    chooseCompPersonLiableFunc(e) {
      // console.log(e);
      let str = this.compPersonLiable.toString();
      this.$store.state.project.flowData.currentNodeItem[
        "compPersonLiable"
      ] = str;
      // this.$store.state.project.flowData.currentNodeItem[
      //   "compPersonLiable"
      // ] = e;
      // console.log(e);
      // console.log(JSON.parse(JSON.stringify(this.$store.state.project)));
      // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData.currentProjectDetail)));
      // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData.currentNodeItem)));
      // return
    },

    //获取团队下所有团队协作人员
    getAllTeamMemberData() {
      getThisProjectAllTeamMember(
        this.$store.state.project.flowData.currentProjectDetail.id
      ).then(res => {
        // console.log(res);
        if (res.status === "SUCCESS") {
          // this.thisProjectAllMember = res.data;
          this.thisProjectAllMember = [];
          if (res.data && res.data.length) {
            res.data.forEach(val => {
              this.thisProjectAllMember.push(val.split(":")[0]);
            });
          }

          // console.log(this.thisProjectAllMember);
        }
      });
    },

    openInputTable() {
      if (this.table_height_input === "0") {
        this.table_height_input = "461px";
        // this.table_height_output = "0";
      } else {
        this.table_height_input = "0";
        // this.table_height_output = "461px";
      }
    },

    openOutputTable() {
      if (this.table_height_output === "0") {
        this.table_height_output = "461px";
        // this.table_height_input = "0";
      } else {
        this.table_height_output = "0";
        // this.table_height_input = "461px";
      }
    },

    viewCurrentNodeItemData(e, typeName) {
      // console.log(e);
      // return
      if (e && e.dataFields && e.dataFields.length) {
        this.viewFieldsVisible = true;
        this.fieldsList = e;
        this.fieldsList.typeName = typeName;
        // this.fieldsList.dataFields = this.fieldsList.dataFields.concat(this.fieldsList.dataFields).concat(this.fieldsList.dataFields)
        // console.log(this.fieldsList);
        this.isFileOutDialog = false;
      }

      if (e && e.fieldsList && e.fieldsList.length) {
        this.viewFieldsVisible = true;
        this.fieldsList = { dataFields: e.fieldsList };
        this.fieldsList.typeName = typeName;
        this.isFileOutDialog = true;
      }
      // console.log(this.fieldsList);
    },

    closeViewFieldsDialog() {
      this.viewFieldsVisible = false;
      this.isFileOutDialog = false;
      this.fieldsList = {};
    },

    handleClose(done) {
      this.$confirm("确认关闭？")
        .then(_ => {
          done();
        })
        .catch(_ => {});
    },
    //下载
    download(path, name) {
      console.log(path);
      let formData = new FormData();
      formData.append("filePath", path);
      downLoadFile(formData).then(res => {
        console.log(res);
        let blob = new Blob([res]);
        let elink = document.createElement("a");
        // 设置下载文件名
        elink.download = name + ".txt";
        elink.style.display = "none";
        elink.href = URL.createObjectURL(blob);
        document.body.appendChild(elink);
        elink.click();
        document.body.removeChild(elink);
      });
    },

    // "选择合并" 弹框 的关闭按钮
    closeMergeDialog() {
      this.compMergeDialogVisible = false;
      this.itemTree = [];
      this.dataSource = [];
      this.selectValue = "";

      this.cancelAddNode();
    },

    //重命名保存 按钮
    confirmReNameFunc() {
      if (
        !this.renameFile.originalFileAddress ||
        !this.renameFile.newFileAddress
      ) {
        this.$notify.error("请输入原文件地址或重命名！");
        return;
      }
      this.confirm("reName");
    },

    //确认保存 "选择合并" 的保存按钮
    confirm(type = "") {
      // console.log(this.concat);
      this.computedIdAndNameFunc(); //在确定之前执行获取一边选择的ID 和 name

      if (this.concat) {
        this.fileParse.push({
          originalFileAddress: "",
          newFileAddress: "",
          fields: []
        });
        this.fileParse[0].fields = this.selDataArray;
        this.fileParse[0].originalFileAddress = "";
        this.fileParse[0].newFileAddress = "";
        this.fileParse = this.fileParse.filter(item => {
          return item.fields.length > 0;
        });
      } else if (this.concat == false) {
        this.fileParse = [];
        this.fileNumClass.forEach((item, index) => {
          this.fileParse.push({
            originalFileAddress: this.fileNumClass[index].originalFileAddress
              ? this.fileNumClass[index].originalFileAddress
              : "",
            newFileAddress: this.fileNumClass[index].newFileAddress
              ? this.fileNumClass[index].newFileAddress
              : "",
            fields: this.selDataArray.filter(
              item => item.fileName == this.fileNumClass[index].fileName
            )
          });
        });
      }

      /////新增字段///////////
      // this.fileParse[0].checkedParentIdList = this.checkedParentIdList || [];
      if (this.fileParse.length) {
        this.fileParse[0]["checkedParentNameList"] =
          this.checkedParentNameList || [];
      }
      /////新增字段///////////

      if (this.concat.toString() === "true" && !this.concatFilePath.trim()) {
        this.$notify.error('请填写"合并文件"！');
        return;
      }

      if (this.concat.toString() === "true" && !this.concatFilePath.trim()) {
        this.$notify.error('请填写"合并文件"！');
        return;
      }

      let nameStr = this.concatFilePath
        .substring(this.concatFilePath.length - 4, this.concatFilePath.length)
        .toLocaleLowerCase();
      // console.log(nameStr);
      if (nameStr !== ".txt" && nameStr !== ".csv") {
        this.$notify.error("合并文件仅支持 txt 、 csv 格式 ！");
        return;
      }

      if (this.concat.toString() === "true" && this.concatFilePath.trim()) {
        if (!this.selDataArray.length) {
          this.$notify.error("请选择合并字段 ！");
          return;
        }

        // console.log(this.$store.state.project.flowData.currentNodeItem);
        this.$store.state.project.flowData.currentNodeItem.outputs &&
          this.$store.state.project.flowData.currentNodeItem.outputs.map(
            val => {
              val.key = this.concatFilePath.trim();
            }
          );
      }

      if (type === "reName") {
        this.fileParse = [{ originalFileAddress: "", newFileAddress: "" }];
        // console.log(this.renameFile.originalFileAddress,this.renameFile.newFileAddress);
        this.fileParse[0].originalFileAddress = this.renameFile.originalFileAddress;
        this.fileParse[0].newFileAddress = this.renameFile.newFileAddress;
      }

      if (
        this.$store.state.project.flowData.currentNodeItem.targetAlgorithm ==
        "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse"
      ) {
        this.$store.state.project.flowData.currentNodeItem.parseType = this.selectValue;
        this.$store.state.project.flowData.currentNodeItem.concat = this.concat;
        this.$store.state.project.flowData.currentNodeItem.fileParse = this.fileParse;
        this.$store.state.project.flowData.currentNodeItem.concatFilePath = this.concatFilePath;
        this.$store.state.project.flowData.currentNodeItem.renameFile = this.renameFile;
      }
      console.log(
        "%c 🧀",
        "color:#93c0a4",
        JSON.parse(
          JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
        )
      );

      // return
      this.confirmSaveFunc();
    },

    //保存流程 方法
    confirmSaveFunc() {
      //保存流程
      //当前选中工程项
      var curProjectItem = this.flowData.currentProjectDetail;
      console.log(curProjectItem);
      if (curProjectItem.id) {
        this.saveCurrentFlowJson();
      } else {
        this.$notify({
          title: "提示",
          message: "请先选择工程！",
          type: "warning"
        });
      }
    },

    //同步流程json数据到服务端
    saveCurrentFlowJson() {
      var that = this;
      var curProjectItem = that.flowData.currentProjectDetail;
      var data = {};
      var nodes = that.flowData.nodes;
      var links = that.flowData.links;
      var compType = this.$store.state.project.systemComponents[0].children;
      let array1 = [];
      let array2 = [];

      compType.forEach(item => {
        item.children.forEach(aItem => {
          nodes.forEach(bItem => {
            // if (bItem.fileParse && bItem.fileParse.length > 0) {
            //   bItem.fileParse.splice(bItem.fileParse.length - 1, 1);
            // }
            if (
              aItem.name == bItem.name &&
              (item.name == "分类" ||
                item.name == "回归" ||
                item.name == "聚类" ||
                item.name == "时序模型")
            ) {
              array1.push(item.name);
              array2.push(bItem.name);
            }
          });
        });
      });

      // console.log(nodes);

      // (data["modelType"] = array1), (data["modelAlgorithm"] = array2);
      data["modelType"] = array1;
      data["modelAlgorithm"] = array2;
      data["style"] = that.flowData.contentStyle;
      data["nodes"] = nodes;
      data["links"] = links;

      // console.log(data)
      // return

      let formData = new FormData();
      formData.append("content", JSON.stringify(data));

      this.$.ajax({
        url: that.httpServer + "/api/project/" + curProjectItem.id,
        method: "post",
        data: formData,
        processData: false,
        contentType: false,
        beforeSend: function(xhr) {
          xhr.setRequestHeader("accessToken", localStorage.accessToken);
        },
        success: function(response) {
          that.closeMergeDialog();
          that.$notify({
            title: "提示",
            message: "保存成功",
            type: "success"
          });
        },
        error: function(response) {
          that.closeMergeDialog();
          that.$store.commit("dealRequestError", response);
        }
      });
    },

    fn2(arr) {
      const res = new Map();
      return arr.filter(
        key => !res.has(key.fileName) && res.set(key.fileName, 1)
      );
    },

    //点击去定选中按钮
    setArrayStorageFun() {
      this.selDataArray = this.selDataArray
        .concat(this.setArrayStorage)
        .filter((item, index, self) => {
          return self.indexOf(item) == index;
        });
      this.computedIdAndNameFunc(); //在确定之前执行获取一边选择的ID 和 name
      console.log("%c 🥟 selDataArray", "color:#ea7e5c", this.selDataArray);
    },

    //删除一个字段
    deleteThisChecked(row) {
      // console.log(this.selDataArray);
      this.selDataArray.forEach((item, idx) => {
        if (
          item.describe.toString() === row.describe.toString() &&
          item.index.toString() === row.index.toString() &&
          item.name.toString() === row.name.toString()
        ) {
          // this.selDataArray = this.selDataArray.splice(idx,1)
          this.selDataArray.splice(idx, 1);
        }
      });
      // console.log(this.selDataArray);
      // console.log(row);
    },

    //在确定之前执行获取一边选择的ID 和 name
    computedIdAndNameFunc() {
      //////////
      let checkedParentIdList = [];
      this.checkedParentNameList = [];
      this.selDataArray &&
        this.selDataArray.forEach(ele => {
          if (ele.oldId) {
            checkedParentIdList = checkedParentIdList.concat(ele.oldId);
          }
        });
      checkedParentIdList = [...new Set(checkedParentIdList)];
      // console.log(this.checkedParentIdList);
      // console.log(this.dataSource);
      checkedParentIdList &&
        checkedParentIdList.forEach(ele => {
          this.dataSource &&
            this.dataSource.forEach(val => {
              val.sourcePortId &&
                val.sourcePortId.forEach(item => {
                  if (ele.toString() === item.portId.toString()) {
                    this.checkedParentNameList.push({
                      id: item.portId,
                      name: item.portName
                    });
                  }
                });
            });
        });
      this.checkedParentNameList = this.uniqueArrFunc(
        this.checkedParentNameList,
        "id"
      );
      // console.log(this.checkedParentIdList,this.checkedParentNameList)
      // console.log(this.checkedParentNameList)
      // return
      ///////////
    },

    //数组中对象去重
    uniqueArrFunc(...args) {
      //第一个参数 list 第二个参数 去重的key
      const res = new Map();
      const flag = arguments[1];
      return arguments[0].filter(
        item => !res.has(item[flag]) && res.set(item[flag], item)
      );
    },

    handleCheckFunc(nodeObj, selectedObj) {
      // console.log(this.dataSource);
      // console.log(nodeObj,selectedObj.checkedNodes);
      let hasCheckedIdList = [];
      if (selectedObj.checkedNodes.length) {
        selectedObj.checkedNodes.forEach(ele => {
          if (ele.hasOwnProperty("portId") && ele.hasOwnProperty("portName")) {
            hasCheckedIdList.push(ele.portId);
          }
        });
        // console.log(hasCheckedIdList);
        if (hasCheckedIdList.length) {
          let allPuts = [];
          // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData)));
          // console.log(JSON.parse(JSON.stringify(JSON.parse(this.$store.state.project.flowData.currentProjectDetail.json))));
          let allNodes = JSON.parse(
            this.$store.state.project.flowData.currentProjectDetail.json
          )["nodes"];
          // console.log(allNodes);
          allNodes &&
            allNodes.forEach(ele => {
              if (ele.inputs.length) {
                allPuts = allPuts.concat(ele.inputs);
              }
              if (ele.outputs.length) {
                allPuts = allPuts.concat(ele.outputs);
              }
            });
          // console.log(allPuts);
          this.itemTree = [];
          allPuts &&
            allPuts.forEach(val => {
              hasCheckedIdList.forEach(id => {
                if (val.id.toString() === id.toString()) {
                  let newList = JSON.parse(val.columns);
                  newList &&
                    newList.map(ele => {
                      // console.log(ele);
                      ele["oldId"] = id + ele.name + ele.type + ele.describe;
                    });
                  this.itemTree = this.itemTree.concat(newList);
                }
              });
            });
          // console.log(this.itemTree);
          // console.log(this.$store.state.project.flowData.currentNodeItem);
        } else {
          this.itemTree = [];
        }
      } else {
        this.itemTree = [];
      }
    },

    handleCheckChange(data, checked, indeterminate) {
      // console.log(this.$store.state.project.flowData.currentProjectDetail);
      // console.log(this.$store.state.project.flowData.currentNodeItem);
      // console.log(checked);
      return;

      console.log("%c 🍕", "color:#4fff4B", data);
      if (checked) {
        let formData = new FormData();
        formData.append("filePath", data.fileAbsolutePath);

        getFileName(formData).then(res => {
          this.itemTree = res.data;
          this.itemTree.forEach(item => {
            this.$set(item, "fileName", data.fileName);
          });

          console.log("%c 🍬 itemTree", "color:#ffdd4d", this.itemTree);
        });
      } else {
        this.itemTree = [];
      }
    },
    runMethod: function(args) {
      //运行方法
      if (this.flowData.isRunning) {
        this.$notify({
          message: "流程运行中，不允许该操作！",
          type: "warning"
        });
        return;
      }
      //更新运行状态为正在运行
      if (this.flowData.isRunning) {
        this.$store.commit("updateMenuProjectSelectComponent", ""); //更新右侧组件视图
        return;
      }
      //当前选中工程项
      this.$store.dispatch("checkNodeElements").then(checkResult => {
        if (checkResult.testResult) {
          //保存完成后 运行流程
          this.$store.dispatch("saveCurrentFlowJson", args);
        } else {
          this.$notify({
            message: checkResult.msg,
            type: "warning"
          });
        }
      });
    },

    //获取节点状态
    getNodeStatus(projectId, runId) {
      queryInstanceRunStatus(projectId, runId).then(res => {
        // console.log(res);
        if (res.data && res.data.length && res.status === "SUCCESS") {
          //存储过节点状态
          if (res.data && res.data[0] && res.data[0].status) {
            let statusList = res.data[0].status.split(",");
            console.log(statusList);
            statusList &&
              statusList.forEach(val => {
                let newId = val.split("-")[0];
                let newStatus = "status-" + val.split("-")[1];
                this.$store.state.project.flowData.nodes &&
                  this.$store.state.project.flowData.nodes.map(ele => {
                    if (newId.toString() === ele.id.toString()) {
                      ele.runStyle = newStatus;
                    }
                  });
              });

            // let allNodes = JSON.parse(JSON.stringify(this.$store.state.project.flowData.nodes))
            // console.log('allNodes >>>>>>> ',allNodes);
          }
        }
      });
    },

    updateRunStatusFunc() {
      if (
        this.$route.path == "/home/projectTwo" &&
        this.$route.query &&
        this.$route.query.runId
      ) {
      } else {
        console.log("不在运行实例页面不进行节点的状态保存!");
        return;
      }

      // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData)));
      let allNodes = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.nodes)
      );
      let statusStr = [];
      allNodes &&
        allNodes.forEach(val => {
          statusStr.push(val.id + val.runStyle.substr(6, val.runStyle.length));
        });
      // console.log(statusStr.toString());
      queryInstanceRunStatus(
        this.$route.query.id,
        this.$route.query.runId
      ).then(res => {
        // console.log(res);
        if (res.status === "SUCCESS") {
          // status-disW
          // status-working
          // status-sus
          let data = {
            projectId: this.$route.query.id.toString(),
            instanceId: this.$route.query.runId.toString(),
            status: statusStr.toString()
          };
          // console.log(res);
          if (res.data && res.data[0] && res.data[0].status) {
            //存储过节点状态
            data["id"] = res.data[0].id;
            editOrAddInstanceRunStatus(data).then(item => {
              if (item.status === "SUCCESS") {
                console.log("节点运行状态存储成功！");
              } else {
                this.$notify.info("节点运行状态记录失败！");
              }
            });
          } else {
            //未存储过节点运行状态
            editOrAddInstanceRunStatus(data).then(item => {
              if (item.status === "SUCCESS") {
                console.log("节点运行状态存储成功！");
              } else {
                this.$notify.info("节点运行状态记录失败！");
              }
            });
          }
        }
      });
    },

    implement() {
      // status-disW
      // status-working
      // status-sus

      // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData)),
      //   JSON.parse(JSON.stringify(this.$store.state.project.flowData.currentNodeItem)));

      let allLinks = this.$store.state.project.flowData.links; //所有连接关系
      let allNodesData = this.$store.state.project.flowData.nodes; //所有节点的集合
      let thisClickNodeId = this.$store.state.project.flowData.currentNodeItem
        .id; //该次点击的节点的id
      let lastNodesNeedDoing = []; //上个需要执行的节点
      let lastNodesIsDoing = []; //上个正在执行的节点
      let lastNodesHasDoing = []; //上个已经执行完的节点
      let sourceNodeIds = []; //当前点击节点的前面关联的节点 集合
      allLinks &&
        allLinks.forEach(ele => {
          if (ele.target.toString() === thisClickNodeId.toString()) {
            sourceNodeIds.push(ele.source.toString());
          }
        });
      sourceNodeIds = [...new Set(sourceNodeIds)];
      console.log("sourceNodeIds>>>>>", sourceNodeIds);

      if (sourceNodeIds.length) {
        sourceNodeIds.forEach(val => {
          allNodesData &&
            allNodesData.forEach(ele => {
              if (val === ele.id.toString()) {
                if (ele.runStyle === "status-disW") {
                  lastNodesNeedDoing.push(ele.name);
                } else if (ele.runStyle === "status-working") {
                  lastNodesIsDoing.push(ele.name);
                } else if (ele.runStyle === "status-sus") {
                  lastNodesHasDoing.push(ele.name);
                }
              }
            });
        });

        console.log("上一级节点集合>>>>", sourceNodeIds);
        console.log(lastNodesNeedDoing, lastNodesIsDoing, lastNodesHasDoing);

        if (lastNodesIsDoing.length) {
          this.$notify.error("请先执行完成上个节点！");
          return;
        } else if (lastNodesNeedDoing.length && !lastNodesHasDoing.length) {
          this.$notify.error("请先执行上级节点并完成后再执行本节点！");
          return;
        } else if (lastNodesNeedDoing.length && lastNodesHasDoing.length) {
          // console.log('上级节点中存在已执行完成的节点')
        } else if (!lastNodesNeedDoing.length && lastNodesHasDoing.length) {
          // console.log('上级节点中存在已执行完成的节点')
        }
      }

      if (this.currentNodeItem.webUI) {
        window.open(this.currentNodeItem.webUI);
      }

      this.currentNodeItem.runStyle = "status-working";
      // //点击调右键运行该节点的接口
      // var curProjectItem = this.flowData.currentProjectDetail;
      // // if (this.flowData.currentNodeItem.webUI) {
      // //   // window.open(this.flowData.currentNodeItem.webUI);
      // // }
      // if (curProjectItem.id) {
      //   this.runMethod({
      //     run: true,
      //     runIndex: 3,
      //     projectId: this.flowData.currentProjectDetail.id,
      //     componentId: this.flowData.currentNodeId.curNodeId
      //   });
      // } else {
      //   this.$notify({
      //     title: "提示",
      //     message: "请先选择工程！",
      //     type: "warning"
      //   });
      // }
      // let url = `/api/project/execute/2384/only/10000186?executionId=JDzbXT9rSFyn6bWUNq9IVg`;
      // $.ajax({
      //   url: "http://192.168.1.3:8088/dmserver/api/project/execute/2834/only/10000186?executionId=Aw93BeOORlK3Ap5O7rvQ0Q",
      //   method: "get",
      //   dataType: "json",
      // beforeSend: function (xhr) {
      // xhr.setRequestHeader("accessToken", localStorage.accessToken);
      // interval = setInterval(function() {
      //   rootState.global.exceptionDeal.checkExcuteStatue = !rootState.global
      //     .exceptionDeal.checkExcuteStatue;
      //   clearInterval(interval);
      // }, 5000);
      // },
      // success: function (response) {},
      // error: function(response) {
      //   //出现错误，则修改状态为运行结束
      //   state.flowData.isRunning = false;
      //   commit("dealRequestError", response);
      // },
      // complete: function(data) {
      //   if (interval != null) {
      //     clearInterval(interval);
      //   }
      // }
      // });
      // this.currentNodeItem.runStyle = "status-working";
      this.$nextTick(() => {
        this.updateRunStatusFunc();
      });
    },

    // 点击完成
    finishes(runOnce = false) {
      // console.log(this.$store.state.project.flowData.currentNodeItem);
      // console.log(this.$store.state.project.flowData.currentNodeItem.targetAlgorithm);
      // return;

      let currentNodeItem = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
      );
      if (currentNodeItem.runStyle === "status-disW") {
        this.$notify.error("当前节点还未执行，不可完成！");
        return;
      } else if (
        currentNodeItem.targetAlgorithm !==
        "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse"
      ) {
        let compId = JSON.parse(JSON.stringify(currentNodeItem.id)),
          serverId = JSON.parse(JSON.stringify(currentNodeItem.serverId));
        this.copyToolFileFunc(compId, serverId); //复制工具文件
      }

      // this.$store.dispatch("stopFlow");
      let allLinks = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.links)
      ); //所有连接关系
      let allNodesData = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.nodes)
      ); //所有节点的集合
      let thisClickNodeId = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.currentNodeItem.id)
      ); //该次点击的节点的id
      let lastNodesNeedDoing = []; //上个需要执行的节点
      let lastNodesIsDoing = []; //上个正在执行的节点
      let lastNodesHasDoing = []; //上个已经执行完的节点
      let sourceNodeIds = []; //当前点击节点的前面关联的节点 集合
      let nextNodesIds = []; //后续要运行的节点的集合

      // console.log(allLinks);
      allLinks &&
        allLinks.forEach(ele => {
          if (ele.target.toString() === thisClickNodeId.toString()) {
            sourceNodeIds.push(ele.source.toString());
          }
          if (ele.source.toString() === thisClickNodeId.toString()) {
            nextNodesIds.push(ele.target.toString());
          }
        });
      sourceNodeIds = [...new Set(sourceNodeIds)];
      nextNodesIds = [...new Set(nextNodesIds)];

      console.log("nextNodesIds >>>>>>>>>>>>>", nextNodesIds);

      sourceNodeIds.forEach(val => {
        allNodesData &&
          allNodesData.forEach(ele => {
            if (val === ele.id.toString()) {
              if (ele.runStyle === "status-disW") {
                lastNodesNeedDoing.push(ele.name);
              } else if (ele.runStyle === "status-working") {
                lastNodesIsDoing.push(ele.name);
              } else if (ele.runStyle === "status-sus") {
                lastNodesHasDoing.push(ele.name);
              }
            }
          });
      });

      // console.log('上一级节点集合>>>>',sourceNodeIds);
      // console.log('下一级节点集合>>>>',nextNodesIds);
      // console.log('lastNodesNeedDoing>>>',lastNodesNeedDoing,'lastNodesIsDoing>>>>',lastNodesIsDoing,'lastNodesHasDoing>>>>',lastNodesHasDoing);

      // console.log('sourceNodeIds>>>>>',sourceNodeIds,'allLinks>>>>>>>',allLinks);

      this.$nextTick(() => {
        this.updateRunStatusFunc();
      });

      if (!sourceNodeIds.length) {
        // 没有上一级节点
        this.currentNodeItem.runStyle = "status-sus";

        //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 让下级关联的节点 runStyle = 'status-working' ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ /////////
        if (nextNodesIds && nextNodesIds.length) {
          this.$store.state.project.flowData.nodes &&
            this.$store.state.project.flowData.nodes.map(val => {
              nextNodesIds.forEach(ele => {
                if (ele.toString() === val.id.toString()) {
                  val.runStyle = "status-working";
                }
              });
            });
          //自动选中下级节点的最后一个节点
          let isAppItem = [],
            normalItem = [];
          this.$store.state.project.flowData.nodes &&
            this.$store.state.project.flowData.nodes.forEach(item => {
              // if(item.id.toString() === nextNodesIds[nextNodesIds.length - 1].toString()){
              //   this.$store.state.project.flowData.currentNodeItem = item
              // }
              nextNodesIds.forEach(ele => {
                if (item.id.toString() === ele.toString()) {
                  if (
                    item.targetAlgorithm ===
                    "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse"
                  ) {
                    isAppItem.push(item);
                  } else {
                    normalItem.push(item);
                  }
                }
              });
            });
          if (isAppItem.length) {
            this.$store.state.project.flowData.currentNodeItem =
              isAppItem[isAppItem.length - 1];
          } else if (normalItem.length) {
            this.$store.state.project.flowData.currentNodeItem =
              normalItem[normalItem.length - 1];
          }
        }
        ///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑////////
      }

      if (lastNodesIsDoing.length) {
        this.$notify.error("请先执行完成上个节点！");
        return;
      } else if (lastNodesNeedDoing.length && !lastNodesHasDoing.length) {
        this.$notify.error("请先执行上级节点并完成后再执行本节点！");
        return;
      } else if (
        lastNodesNeedDoing.length &&
        lastNodesHasDoing.length &&
        !lastNodesIsDoing.length
      ) {
        this.$notify.error("请先执行上级节点并完成后再执行本节点！");
        return;
      } else if (lastNodesNeedDoing.length && lastNodesHasDoing.length) {
        // console.log('上级节点中存在已执行完成的节点')
        this.currentNodeItem.runStyle = "status-sus";

        //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 让下级关联的节点 runStyle = 'status-working' ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ /////////
        if (nextNodesIds && nextNodesIds.length) {
          this.$store.state.project.flowData.nodes &&
            this.$store.state.project.flowData.nodes.map(val => {
              nextNodesIds.forEach(ele => {
                if (ele.toString() === val.id.toString()) {
                  val.runStyle = "status-working";
                }
              });
            });
          //自动选中下级节点的最后一个节点
          let isAppItem = [],
            normalItem = [];
          this.$store.state.project.flowData.nodes &&
            this.$store.state.project.flowData.nodes.forEach(item => {
              // if(item.id.toString() === nextNodesIds[nextNodesIds.length - 1].toString()){
              //   this.$store.state.project.flowData.currentNodeItem = item
              // }
              nextNodesIds.forEach(ele => {
                if (item.id.toString() === ele.toString()) {
                  if (
                    item.targetAlgorithm ===
                    "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse"
                  ) {
                    isAppItem.push(item);
                  } else {
                    normalItem.push(item);
                  }
                }
              });
            });
          if (isAppItem.length) {
            this.$store.state.project.flowData.currentNodeItem =
              isAppItem[isAppItem.length - 1];
          } else if (normalItem.length) {
            this.$store.state.project.flowData.currentNodeItem =
              normalItem[normalItem.length - 1];
          }
        }
        ///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑////////
      } else if (!lastNodesNeedDoing.length && lastNodesHasDoing.length) {
        this.currentNodeItem.runStyle = "status-sus";

        //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 让下级关联的节点 runStyle = 'status-working' ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ /////////
        if (nextNodesIds && nextNodesIds.length) {
          this.$store.state.project.flowData.nodes &&
            this.$store.state.project.flowData.nodes.map(val => {
              nextNodesIds.forEach(ele => {
                if (ele.toString() === val.id.toString()) {
                  val.runStyle = "status-working";
                }
              });
            });
          //自动选中下级节点的最后一个节点
          let isAppItem = [],
            normalItem = [];
          this.$store.state.project.flowData.nodes &&
            this.$store.state.project.flowData.nodes.forEach(item => {
              // if(item.id.toString() === nextNodesIds[nextNodesIds.length - 1].toString()){
              //   this.$store.state.project.flowData.currentNodeItem = item
              // }
              nextNodesIds.forEach(ele => {
                if (item.id.toString() === ele.toString()) {
                  if (
                    item.targetAlgorithm ===
                    "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse"
                  ) {
                    isAppItem.push(item);
                  } else {
                    normalItem.push(item);
                  }
                }
              });
            });
          if (isAppItem.length) {
            this.$store.state.project.flowData.currentNodeItem =
              isAppItem[isAppItem.length - 1];
          } else if (normalItem.length) {
            this.$store.state.project.flowData.currentNodeItem =
              normalItem[normalItem.length - 1];
          }
        }
        ///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑////////
      }

      //如果当前节点是app 文件转换，则在本节点上自动执行并在2秒后完成
      if (
        this.$store.state.project.flowData.currentNodeItem.targetAlgorithm ===
        "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse"
      ) {
        // console.log(runOnce);
        if (runOnce) {
          return;
        }

        this.implement();

        let selfComp = JSON.parse(
          JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
        );
        // console.log(selfComp);

        // console.log('nextNodesIds>>>>>>',nextNodesIds);

        if (!nextNodesIds.length) {
          //没有下级节点了
          this.autoRunFunc(
            selfComp,
            () => {
              // this.$notify.success("自动执行 " + this.$store.state.project.flowData.currentNodeItem.name);
              setTimeout(() => {
                this.finishes(true);
              }, 100);
            },
            true
          );
        } else {
          this.autoRunFunc(
            selfComp,
            () => {
              this.$notify.success(
                "自动执行 " +
                  this.$store.state.project.flowData.currentNodeItem.name
              );
              setTimeout(() => {
                this.finishes(false);
              }, 2000);
            },
            false
          );
        }

        // this.$notify.success("自动执行 " + this.$store.state.project.flowData.currentNodeItem.name);
        // setTimeout(() => {
        //   this.finishes();
        // }, 1000);
      }

      //如果当前节点 操作为执行空操作，则在本节点上自动执行并在0.5秒后完成
      if (
        this.$store.state.project.flowData.currentNodeItem.targetAlgorithm ===
        "com.tipdm.framework.dmserver.core.algo.unparallel.DummyAlgorithm"
      ) {
        // this.$notify.success('自动执行 ' + this.$store.state.project.flowData.currentNodeItem.name)
        // this.implement();
        setTimeout(() => {
          this.finishes(false);
          this.$store.state.project.flowData.currentNodeItem.targetAlgorithm =
            "";
        }, 500);
      }

      this.$nextTick(() => {
        this.updateRunStatusFunc();
      });
    },

    //自动执行app文件转换
    autoRunFunc(selfComp, cb, noTips = false) {
      // console.log(selfComp);

      let fileInfos = [];
      let fieldsList = [];
      let endFieldsList = [];
      selfComp.fileParse &&
        selfComp.fileParse.forEach(val => {
          val.checkedParentNameList &&
            val.checkedParentNameList.forEach(ele => {
              fileInfos.push({
                id: Number(ele.id.split("_")[0]),
                componentId: Number(ele.id.split("_")[0]),
                author: "",
                name: ele.name,
                runId: this.$route.query.runId
                  ? Number(this.$route.query.runId)
                  : null, //实例id 没有则传 ""
                projectId: Number(this.$route.query.id) //工具流本身的id
              });
            });

          val.fields &&
            val.fields.forEach(item => {
              fieldsList.push({
                field: item.name,
                asColumn: item.name
              });
              endFieldsList.push(item);
            });
        });

      let newObj = {
        fileInfos: fileInfos,
        fieldParams: fieldsList
      };

      // let outPutList = []
      // selfComp.outputs && selfComp.outputs.forEach(ele=>{
      //   outPutList.push({
      //     "outPutFileKey": ele.key, //输出点的key
      //     "runId": this.$route.query.runId || '', //实例id 没有则传 ""
      //     "componentId": selfComp.id, //文件转换组件 的id
      //     "projectId": this.$route.query.id,// 工具流本身的id
      //     "parseFile": newObj
      //   })
      // })

      let outPutList = [
        {
          outPutFileKey: this.$store.state.project.flowData.currentNodeItem
            .concatFilePath, //ele.key, // 合并文件的key 即 concatFilePath  //输出点的key
          runId: this.$route.query.runId
            ? Number(this.$route.query.runId)
            : null, //实例id 没有则传 ""
          componentId: Number(selfComp.id), //文件转换组件 的id
          projectId: Number(this.$route.query.id), // 工具流本身的id
          parseFile: newObj
        }
      ];

      let newData = {
        id: Number(selfComp.id), //文件转换组件 的id
        outPuts: outPutList
      };

      // console.log(newData);
      // cb && cb()// delete when test end

      fileChangeWhenAutoRun(newData).then(res => {
        // console.log(res);
        if (res.status == "SUCCESS") {
          if (noTips) {
          } else {
            this.$message.success(res.message + "!");
          }

          // this.fileOutAfterRunList.push({
          //   id:Number(selfComp.id),
          //   key:outPutList[0].outPutFileKey,
          //   fieldsList:endFieldsList,
          // })
          this.$store.state.project.flowData.currentNodeItem[
            "fileOutAfterRunList"
          ] = [];
          this.$store.state.project.flowData.currentNodeItem[
            "fileOutAfterRunList"
          ].push({
            id: Number(selfComp.id),
            key: outPutList[0].outPutFileKey,
            fieldsList: endFieldsList
          });
        } else {
          this.$message.error(res.message + "!");
        }

        // console.log(this.fileOutAfterRunList);
        cb && cb();
      });
    },

    //复制工具文件
    copyToolFileFunc(compId, serverId) {
      // let thisCurrentNodeItem = this.$store.state.project.flowData.currentNodeItem
      // thisCurrentNodeItem.id\thisCurrentNodeItem.serverId
      // console.log(this.$store.state.project.flowData.currentNodeItem);
      //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 复制工具文件↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
      //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 复制工具文件↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
      // console.log(this.$route.query);
      // return
      let newUrl =
        this.$route.query.id && this.$route.query.runId
          ? this.$store.state.global.httpServer +
            "/api/file/copyToolFileToLocal/" +
            this.$route.query.id +
            "/" +
            this.$route.query.runId +
            "/" +
            compId +
            "/" +
            serverId
          : this.$store.state.global.httpServer +
            "/api/file/copyToolFileToLocal/" +
            compId +
            "/" +
            serverId;
      this.$.ajax({
        url: newUrl,
        method: "get",
        contentType: false, //"multipart/form-data",
        // data:fd,
        // processData: false,
        headers: {
          accessToken: localStorage.getItem("accessToken")
        },
        success: res => {
          // console.log(res)
        },
        error: err => {}
      });
      ///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
      ///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
      // return;
    },

    handleChangeSel(e) {
      // console.log(e);
      // if(e == 'keyAdd'){
      //   this.selectValue = 'keyAdd'
      // }
      this.$store.state.project.flowData.currentNodeItem.parseType = this.selectValue;
      // this.selDataArray = [];
      // this.setArrayStorage = [];
      // this.itemTree = [];
      // this.fileParse = [];
      console.log(
        "%c 🍆 id",
        "color:#2eafb0",
        this.$store.state.project.flowData.currentProjectDetail.id
      );
      console.log(
        "%c 🍆 id",
        "color:#2eafb0",
        this.$store.state.project.flowData.currentNodeItem.id
      );

      ///////////////////////////////////////// 查询当前节点 上一级关联的节点
      ///////////////////////////////////////// 查询当前节点 上一级关联的节点
      let allLinks = this.$store.state.project.flowData.links; //所有连接关系
      let allNodesData = this.$store.state.project.flowData.nodes; //所有节点的集合
      let thisClickNodeId = this.$store.state.project.flowData.currentNodeItem
        .id; //该次点击的节点的id
      // console.log(allLinks);
      let sourceNodeIds = []; //当前点击节点的前面关联的节点 集合
      allLinks &&
        allLinks.forEach(ele => {
          if (ele.target.toString() === thisClickNodeId.toString()) {
            sourceNodeIds.push(ele.source.toString());
          }
        });
      sourceNodeIds = [...new Set(sourceNodeIds)];

      // console.log(sourceNodeIds);
      ////////////////////////////////////////////////////////////////////////////////////////////////
      ////////////////////////////////////////////////////////////////////////////////////////////////

      if (this.$route.path == "/home/project") {
        ////////////////////////////////////////////////////获取当前节点 的上级节点的outputs数据
        // console.log(JSON.parse(JSON.stringify(allNodesData)));
        let newData = [];
        sourceNodeIds &&
          sourceNodeIds.forEach(ele => {
            allNodesData &&
              allNodesData.forEach(val => {
                if (val.id.toString() === ele.toString()) {
                  let newObj = {
                    id: ele,
                    fileName: val.name,
                    sourcePortId: []
                  };
                  val.outputs &&
                    val.outputs.forEach(item => {
                      newObj.sourcePortId.push({
                        id: item.id,
                        fileName: item.key,
                        portId: item.id,
                        portName: item.key
                      });
                    });
                  newData.push(newObj);
                }
              });
          });
        // console.log(newData);
        ////////////////////////////////////////////////////获取当前节点 的上级节点的outputs数据
        this.dataSource = newData;

        /*

        getSuperiorInfo(
          this.$store.state.project.flowData.currentProjectDetail.id,
          this.$store.state.project.flowData.currentNodeItem.id,
          // sourceNodeIds
        ).then(res => {
          // console.log(res.data);
          res && res.data && res.data.map(val=>{
            if(val.sourcePortId.length){
              val.sourcePortId.map(ele=>{
                ele['id'] = ele.portId
                ele['fileName'] = ele.portName
              })
            }
          })
          // this.dataSource = res.data;
        });

        */

        // getOutputName("B").then(res => {
        //   if (res.status == "SUCCESS") {
        //     console.log(
        //       "%c 🦐 res: ",
        //       "font-size:20px;background-color: #E41A6A;color:#fff;",
        //       res
        //     );
        //     this.dataSource = res.data;
        //   }
        // });
      }

      if (e.toString() === "selectionParam") {
        //     || e.toString() === 'keyAdd'
        console.log(
          JSON.parse(
            JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
          )
        );
        // if(this.$store.state.project.flowData.currentNodeItem.targetAlgorithm.indexOf('algo.unparallel.file.Parse') < 0){
        if (this.$route.path == "/home/project") {
          this.compMergeDialogVisible = true; //选择合并的弹框
        }
      }
    },
    cellOnBlur(item) {
      this.$set(item, "isRename", false);
      // this.$set(item, "rename", item.rename);
    },
    cellDblclick(row, column, cell, event) {
      if (column.label == "别名") {
        this.$set(row, "isRename", true);
        this.$set(row, "asColumn", row.asColumn);
        this.$nextTick(() => {
          this.$refs.inputVal.focus();
        });
      }
    },
    handleSelectionChange(e) {
      // console.log(
      //   "%c 🥝 e, index: ",
      //   "font-size:20px;background-color: #B03734;color:#fff;",
      //   e
      // );
      this.setArrayStorage = e;
      // this.fileParse[index].fields = e;
    },
    handleRemove(file, fileList) {
      this.fileAdd(file, fileList);
    },
    fileAdd(file, fileList) {
      this.fieldArray = [];
      fileList.forEach(item => {
        let fileObj = item.raw; // 相当于input里取得的files
        let fReader = new FileReader();
        fReader.readAsDataURL(fileObj);
        fReader.onload = evt => {
          // 检查编码
          let encoding = this.checkEncoding(evt.target.result);

          // 将csv转换成二维数组
          Papa.parse(fileObj, {
            encoding,
            complete: res => {
              // UTF8 \r\n与\n混用时有可能会出问题
              let data = res.data;
              if (data[data.length - 1] == "") {
                //去除最后的空行
                data.pop();
              }
              let newArr = [];
              for (let i = 0; i < data[0].length; i++) {
                let obj = {};
                obj.field = data[0][i];
                obj.asColumn = "";
                obj.selection = true;
                newArr.push(obj);
              }
              // for (let i = 0; i < data.length; i++) {
              //   let obj = {};
              //   for (let j = 0; j < data[0].length; j++) {
              //     obj[data[0][j]] = data[i][j];
              //   }
              //   newArr.push(obj);
              // }
              // newArr.splice(1); //将数组第一位的表格名称去除
              this.fieldArray.push(newArr);
            }
          });
        };
      });
      this.fileParse.push({
        originalFileAddress: "",
        newFileAddress: "",
        fields: [
          {
            selection: false,
            field: "",
            asColumn: ""
          }
        ]
      });
    },
    // 检查编码，引用了 jschardet
    checkEncoding(base64Str) {
      // 这种方式得到的是一种二进制串
      let str = atob(base64Str.split(";base64,")[1]);
      // 要用二进制格式
      let encoding = jschardet.detect(str);
      encoding = encoding.encoding;
      if (encoding == "windows-1252") {
        // 有时会识别错误（如UTF8的中文二字）
        encoding = "ANSI";
      }
      return encoding;
    },
    handleRowClick(row, column, event) {
      if (row.directory == true && (row.inputKeyName || row.outPutKeyName)) {
        let formData = new FormData();
        formData.append("filePath", row.fileAbsolutePath);
        getFileName(formData).then(res => {
          if (res.status == "SUCCESS") {
            this.tableData = res.data;
          }
        });
      } else {
        this.tableData = [];
      }
    },
    searchFile() {
      let formData = new FormData();
      formData.append(
        "filePath",
        this.$store.state.project.flowData.currentNodeItem.searchFilePath
      );
      // directorySearch(formData)
      //   .then(res => {
      //     if (res.status == "SUCCESS") {
      //       this.fileDataList = res.data;
      //     } else {
      //       this.fileDataList = [];
      //       this.tableData = [];
      //     }
      //   })
      //   .catch(err => {
      //     this.fileDataList = [];
      //     this.tableData = [];
      //   });
    },
    handleNodeClick(data, node) {
      if (data.directory) {
        let formData = new FormData();
        formData.append("filePath", data.fileAbsolutePath);
        this.pathXZ = data.fileAbsolutePath;
        getFileName(formData).then(res => {
          this.tableData = res.data;
        });
      }
    },
    loadTable(tree, treeNode, resolve) {
      let formData = new FormData();
      formData.append("filePath", tree.fileAbsolutePath);
      directorySearch(formData).then(res => {
        if (res.status == "SUCCESS") {
          setTimeout(() => {
            return resolve(res.data);
          }, 300);
        }
      });
    },
    loadNode(node, resolve) {
      if (node.level >= 1) {
        if (!node.data.directory) {
          let formData = new FormData();
          formData.append("filePath", node.data.fileAbsolutePath);
          directorySearch(formData).then(res => {
            if (res.status == "SUCCESS") {
              // this.fileDataList.forEach(item => {
              //   if (item.parentFilePath == node.data.parentFilePath) {
              //     item.children = res.data;
              //   }
              // });
              return resolve(res.data);
            }
          });
        } else {
          let formData = new FormData();
          let air = node.data.parentFilePath + "\\" + node.data.fileName;
          formData.append("filePath", air);
          getFileName(formData).then(res => {
            this.tableData = res.data;
          });
          return resolve([]);
        }
      }
    },
    loadNodeTwo(node, resolve) {
      // if (node.level >= 1) {
      //   getOutputName(node.data.fileName).then(res => {
      //     if (res.status == "SUCCESS") {
      //       return resolve(res.data);
      //     }
      //   });
      // }
    },

    //输出文件下载
    downloadOutFileFunc(row, isOutputDownload = false) {
      //TODO 输出文件下载
      // if(isOutputDownload){
      //   // <!--                v-if="canDownloadNameList.length"-->
      //   // <!--                this.$route.path === '/home/projectTwo-->
      //   // <!-- v-if="canDownloadNameList.length && $route.path === '/home/projectTwo' "
      //   // v-if="canDownloadNameList.indexOf(scope.row.key) >= 0" -->
      //   if(this.canDownloadNameList.length && this.canDownloadNameList.indexOf(row.key) >= 0 && this.$route.path === '/home/projectTwo'){
      //
      //   }else{
      //     this.$message.info('无输出文件！')
      //     return
      //   }
      //
      // }

      // console.log(row);
      // return
      let formData = new FormData();
      formData.append("fileName", row.key);
      formData.append(
        "componentId",
        this.$store.state.project.flowData.currentNodeItem.id
      );
      if (this.$route.query.id) {
        formData.append("projectId", this.$route.query.id);
      }
      if (this.$route.query.runId) {
        formData.append("runId", this.$route.query.runId);
      }

      this.$.ajax({
        url: this.$store.state.global.httpServer + "/api/file/downLoadFile",
        method: "post",
        contentType: false, //"multipart/form-data",
        data: formData,
        processData: false,
        headers: {
          accessToken: localStorage.getItem("accessToken")
        },
        success: res => {
          // console.log(res)
          let blob = new Blob([res]);
          let eLink = document.createElement("a");
          // 设置下载文件名
          // if(row.key.indexOf('.txt') >0 ){

          // console.log(row.key.substring(row.key.length - 4, row.key.length).toLocaleLowerCase());
          if (
            row.key
              .substring(row.key.length - 4, row.key.length)
              .toLocaleLowerCase() === ".txt"
          ) {
            eLink.download = row.key;
          } else {
            eLink.download = row.key + ".txt";
          }

          eLink.style.display = "none";
          eLink.href = URL.createObjectURL(blob);
          document.body.appendChild(eLink);
          eLink.click();
          document.body.removeChild(eLink);
        },
        error: err => {}
      });
    },

    //删除一个节点
    deleteSingleNode(row, rowIndex, where) {
      // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData.links)));
      // console.log(JSON.parse(JSON.stringify(row,rowIndex)));

      if (where === "input") {
        let allLinks = JSON.parse(
          JSON.stringify(this.$store.state.project.flowData.links)
        );
        // console.log(allLinks);
        let repeatIndex = null;
        allLinks &&
          allLinks.forEach((val, idx) => {
            if (val.inputPortId.toString() === row.id.toString()) {
              repeatIndex = idx;
            }
          });
        if (repeatIndex === 0 || repeatIndex > 0 || row.isConnected) {
          //当前节点有连线
          this.$confirm("确认删除当前节点及连线?", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
            .then(() => {
              this.$store.state.project.flowData.links.splice(repeatIndex, 1); //删除连线
              this.$store.state.project.flowData.currentNodeItem.inputs.splice(
                rowIndex,
                1
              ); //删除inputs中数据
              let deleteIndex = null;
              this.$store.state.project.flowData.currentNodeItem.inputData.forEach(
                (ele, index) => {
                  if (
                    row.key.toString() === ele.key.toString() &&
                    row.description.toString() === ele.description.toString()
                  ) {
                    deleteIndex = index;
                  }
                }
              );
              this.$store.state.project.flowData.currentNodeItem.inputData.splice(
                deleteIndex,
                1
              ); //删除inputData中数据
            })
            .catch(() => {});
        } else {
          //当前节点无连线
          this.$store.state.project.flowData.currentNodeItem.inputs.splice(
            rowIndex,
            1
          );
          let deleteIndex = null;
          this.$store.state.project.flowData.currentNodeItem.inputData.forEach(
            (ele, index) => {
              if (
                row.key.toString() === ele.key.toString() &&
                row.description.toString() === ele.description.toString()
              ) {
                deleteIndex = index;
              }
            }
          );
          this.$store.state.project.flowData.currentNodeItem.inputData.splice(
            deleteIndex,
            1
          );
        }
      } else if (where === "output") {
        let allLinks = JSON.parse(
          JSON.stringify(this.$store.state.project.flowData.links)
        );
        // console.log(allLinks);
        let repeatIndex = null;
        allLinks &&
          allLinks.forEach((val, idx) => {
            if (val.outputPortId.toString() === row.id.toString()) {
              repeatIndex = idx;
            }
          });
        if (repeatIndex === 0 || repeatIndex > 0 || row.isConnected) {
          //当前节点有连线
          this.$confirm("确认删除当前节点及连线?", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
            .then(() => {
              this.$store.state.project.flowData.links.splice(repeatIndex, 1); //删除连线
              this.$store.state.project.flowData.currentNodeItem.outputs.splice(
                rowIndex,
                1
              ); //删除inputs中数据
              let deleteIndex = null;
              this.$store.state.project.flowData.currentNodeItem.outputData.forEach(
                (ele, index) => {
                  if (
                    row.key.toString() === ele.key.toString() &&
                    row.description.toString() === ele.description.toString()
                  ) {
                    deleteIndex = index;
                  }
                }
              );
              this.$store.state.project.flowData.currentNodeItem.outputData.splice(
                deleteIndex,
                1
              ); //删除inputData中数据
            })
            .catch(() => {});
        } else {
          //当前节点无连线
          this.$store.state.project.flowData.currentNodeItem.outputs.splice(
            rowIndex,
            1
          );
          let deleteIndex = null;
          this.$store.state.project.flowData.currentNodeItem.outputData.forEach(
            (ele, index) => {
              if (
                row.key.toString() === ele.key.toString() &&
                row.description.toString() === ele.description.toString()
              ) {
                deleteIndex = index;
              }
            }
          );
          this.$store.state.project.flowData.currentNodeItem.outputData.splice(
            deleteIndex,
            1
          );
        }
      }
    },

    //新增单个输入节点--快速新增
    addNewSingleNodeInput() {
      let nowComp = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
      );
      let nowLength = (nowComp.inputs || []).length || 0;
      let newIndex = Number((nowComp.inputs || []).length + 1);
      if (nowLength >= 10) {
        this.$message.info("最多可定义10个输入节点！");
        return;
      }

      // nowComp.inputs[0] ||
      let newNode = {
        canPreview: false,
        cat: "UNSTRUCT",
        description: "",
        id: nowComp.id + "_1_" + newIndex,
        isConnected: false,
        key: "",
        left: 0,
        model: false,
        type: "INPUT",
        value: nowComp.id + "_1_" + newIndex
      };

      // let newId = newNode.id.split('_')
      // newNode.id = newId[0] + '_' + newId[1] + '_' + newIndex

      // newNode.value[newNode.value.length - 1] = newIndex
      // let newValue = newNode.value.split('_')
      // newNode.value = newValue[0] + '_' + newValue[1] + '_' + newIndex

      newNode.description = "input_" + newIndex;
      newNode.canPreview = false;
      newNode.cat = "UNSTRUCT";
      newNode.isConnected = false;
      newNode.key = "input_" + newIndex;

      newNode.model = false;
      newNode.type = "INPUT";
      if (nowLength === 0) {
        newNode.left = 90;
      } else if (nowLength === 1) {
        newNode.left = 45;
      } else if (nowLength === 2) {
        newNode.left = 90;
      } else if (nowLength === 3) {
        newNode.left = 30;
      } else if (nowLength === 4) {
        newNode.left = 150;
      } else if (nowLength === 5) {
        newNode.left = 0;
      } else if (nowLength === 6) {
        newNode.left = 175;
      } else if (nowLength === 7) {
        newNode.left = 15;
      } else if (nowLength === 8) {
        newNode.left = 163;
      } else if (nowLength === 9) {
        newNode.left = 75;
      } else {
        newNode.left = nowLength * 7;
      }

      this.nodeEditItem = newNode;
      // console.log(this.nodeEditItem);

      let newData = {
        description: this.nodeEditItem.description,
        key: this.nodeEditItem.key,
        type: "INPUT",
        dataFields: [] //this.$refs.newFieldsRef.selection
      };
      this.$store.state.project.flowData.currentNodeItem.inputs.push(
        this.nodeEditItem
      );
      this.$store.state.project.flowData.currentNodeItem.inputData.push(
        newData
      );

      // return
      // this.showNodeEditDialogType = 'input'
      // this.addNodeDialog = true;
    },

    //新增输入节点、输入节点
    addNewNodes(type) {
      ///////////////////////////////////////// 查询当前节点 上一级关联的节点
      ///////////////////////////////////////// 查询当前节点 上一级关联的节点
      let allLinks = this.$store.state.project.flowData.links; //所有连接关系
      let allNodesData = this.$store.state.project.flowData.nodes; //所有节点的集合
      let thisClickNodeId = this.$store.state.project.flowData.currentNodeItem
        .id; //该次点击的节点的id
      // console.log('allLinks >>>>>>>',allLinks);
      // console.log('allNodesData >>>>>>>',allNodesData);
      let sourceNodeIds = []; //当前点击节点的前面关联的节点 集合
      allLinks &&
        allLinks.forEach(ele => {
          if (ele.target.toString() === thisClickNodeId.toString()) {
            sourceNodeIds.push(ele.source.toString());
          }
        });
      sourceNodeIds = [...new Set(sourceNodeIds)];

      // console.log(sourceNodeIds);
      ////////////////////////////////////////////////////////////////////////////////////////////////
      ////////////////////////////////////////////////////////////////////////////////////////////////

      // if (this.$route.path == "/home/project") {
      ////////////////////////////////////////////////////获取当前节点 的上级节点的outputs数据
      // console.log(JSON.parse(JSON.stringify(allNodesData)));
      let newData = [];
      sourceNodeIds &&
        sourceNodeIds.forEach(ele => {
          allNodesData &&
            allNodesData.forEach(val => {
              if (val.id.toString() === ele.toString()) {
                let newObj = {
                  id: ele,
                  fileName: val.name,
                  sourcePortId: []
                };
                val.outputs &&
                  val.outputs.forEach(item => {
                    newObj.sourcePortId.push({
                      id: item.id,
                      fileName: item.key,
                      portId: item.id,
                      portName: item.key
                    });
                  });
                newData.push(newObj);
              }
            });
        });
      // console.log(newData);
      ////////////////////////////////////////////////////获取当前节点 的上级节点的outputs数据
      this.dataSource = newData;
      // }

      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

      let nowComp = JSON.parse(
        JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
      );
      // console.log(nowComp);
      // nowComp.inputs = []
      // console.log(nowComp);
      if (type === "input") {
        let newNode = nowComp.inputs[0] || {
          canPreview: false,
          cat: "UNSTRUCT",
          description: "",
          id: nowComp.id + "_1_1",
          isConnected: false,
          key: "",
          left: 0,
          model: false,
          type: "INPUT",
          value: nowComp.id + "_1_1"
        };

        let nowLength = nowComp.inputs.length || 0;
        if (nowLength >= 10) {
          this.$message.info("最多可定义10个输入节点！");
          return;
        }

        let newIndex = Number(nowComp.inputs.length + 1);

        let newId = newNode.id.split("_");
        newNode.id = newId[0] + "_" + newId[1] + "_" + newIndex;

        // newNode.value[newNode.value.length - 1] = newIndex
        let newValue = newNode.value.split("_");
        newNode.value = newValue[0] + "_" + newValue[1] + "_" + newIndex;

        newNode.description = "";
        newNode.canPreview = false;
        newNode.cat = "UNSTRUCT";
        newNode.isConnected = false;
        newNode.key = "";

        newNode.model = false;
        newNode.type = "INPUT";

        if (nowLength === 0) {
          newNode.left = 90;
        } else if (nowLength === 1) {
          newNode.left = 45;
        } else if (nowLength === 2) {
          newNode.left = 90;
        } else if (nowLength === 3) {
          newNode.left = 30;
        } else if (nowLength === 4) {
          newNode.left = 150;
        } else if (nowLength === 5) {
          newNode.left = 0;
        } else if (nowLength === 6) {
          newNode.left = 175;
        } else if (nowLength === 7) {
          newNode.left = 15;
        } else if (nowLength === 8) {
          newNode.left = 163;
        } else if (nowLength === 9) {
          newNode.left = 75;
        } else {
          newNode.left = nowLength * 7;
        }

        // let newList = nowComp.inputData
        // this.addFields = []
        // newList && newList.forEach(val=>{
        //   val.dataFields && val.dataFields.forEach(ele=>{
        //     this.addFields.push({
        //       name:ele.name || '',
        //       describe:ele.describe || '',
        //       type:ele.type || 'String',
        //       index:ele.index || 0
        //     })
        //   })
        //
        // })

        // console.log(this.addFields);

        // console.log(newNode);
        this.nodeEditItem = newNode;
        // this.showNodeEditDialog = true;
        this.showNodeEditDialogType = "input";
        // this.handleChangeSel('keyAdd')
        this.addNodeDialog = true;

        // this.$store.state.project.flowData.currentNodeItem.inputs.push(newNode)
      } else if (type === "output") {
        let newNode = nowComp.outputs[0] || {
          canPreview: false,
          cat: "UNSTRUCT",
          description: "",
          id: nowComp.id + "_0_1",
          isConnected: false,
          key: "",
          left: 0,
          model: false,
          type: "OUTPUT",
          value: nowComp.id + "_0_1"
        };

        // let newNode = nowComp.outputs[0]
        let nowLength = nowComp.outputs.length || 0;
        if (nowLength >= 10) {
          this.$message.info("最多可定义10个输出节点！");
          return;
        }

        let newIndex = Number(nowComp.outputs.length + 1);

        let newId = newNode.id.split("_");
        newNode.id = newId[0] + "_" + newId[1] + "_" + newIndex;

        // newNode.value[newNode.value.length - 1] = newIndex
        let newValue = newNode.value.split("_");
        newNode.value = newValue[0] + "_" + newValue[1] + "_" + newIndex;

        newNode.description = "";
        newNode.canPreview = false;
        newNode.cat = "UNSTRUCT";
        newNode.isConnected = false;
        newNode.key = "";

        newNode.model = false;
        newNode.type = "OUTPUT";

        if (nowLength === 0) {
          newNode.left = 90;
        } else if (nowLength === 1) {
          newNode.left = 45;
        } else if (nowLength === 2) {
          newNode.left = 90;
        } else if (nowLength === 3) {
          newNode.left = 30;
        } else if (nowLength === 4) {
          newNode.left = 150;
        } else if (nowLength === 5) {
          newNode.left = 0;
        } else if (nowLength === 6) {
          newNode.left = 175;
        } else if (nowLength === 7) {
          newNode.left = 15;
        } else if (nowLength === 8) {
          newNode.left = 163;
        } else if (nowLength === 9) {
          newNode.left = 75;
        } else {
          newNode.left = nowLength * 7;
        }

        this.nodeEditItem = newNode;
        this.showNodeEditDialogType = "output";

        this.addNodeDialog = true;
        // this.handleChangeSel('keyAdd')
      }
    },

    // addNewFieldsFunc(type){
    //   if(type === 'input'){
    //     // let nowComp = JSON.parse(JSON.stringify(this.$store.state.project.flowData.currentNodeItem))
    //     this.addFields.push({name:'',type:'String',index:this.addFields.length,description:''})
    //   }
    //
    // },

    reviewFileChangeData(e, type) {
      ///////////////////////////////////////// 查询当前节点 上一级关联的节点
      let allLinks = this.$store.state.project.flowData.links; //所有连接关系
      let allNodesData = this.$store.state.project.flowData.nodes; //所有节点的集合
      let thisClickNodeId = this.$store.state.project.flowData.currentNodeItem
        .id; //该次点击的节点的id
      // console.log('allLinks >>>>>>>',allLinks);
      // console.log('allNodesData >>>>>>>',allNodesData);
      let sourceNodeIds = []; //当前点击节点的前面关联的节点 集合
      allLinks &&
        allLinks.forEach(ele => {
          if (ele.target.toString() === thisClickNodeId.toString()) {
            sourceNodeIds.push(ele.source.toString());
          }
        });
      sourceNodeIds = [...new Set(sourceNodeIds)];

      // console.log(sourceNodeIds);
      ////////////////////////////////////////////////////////////////////////////////////////////////
      ////////////////////////////////////////////////////////////////////////////////////////////////

      // if (this.$route.path == "/home/project") {
      ////////////////////////////////////////////////////获取当前节点 的上级节点的outputs数据
      // console.log(JSON.parse(JSON.stringify(allNodesData)));
      let newData = [];
      sourceNodeIds &&
        sourceNodeIds.forEach(ele => {
          allNodesData &&
            allNodesData.forEach(val => {
              if (val.id.toString() === ele.toString()) {
                let newObj = {
                  id: ele,
                  fileName: val.name,
                  sourcePortId: []
                };
                val.outputs &&
                  val.outputs.forEach(item => {
                    newObj.sourcePortId.push({
                      id: item.id,
                      fileName: item.key,
                      portId: item.id,
                      portName: item.key
                    });
                  });
                newData.push(newObj);
              }
            });
        });
      // console.log(newData);
      ////////////////////////////////////////////////////获取当前节点 的上级节点的outputs数据
      this.dataSource = newData;
      // }

      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

      // console.log(e, type);
      this.showNodeEditDialogType = type;
      this.nodeDialogIsReview = true;
      this.nodeEditItem = e;

      if (type === "input") {
        this.record_xPutIndex = null;
        this.record_xPutDataIndex = null;
        this.$store.state.project.flowData.currentNodeItem.inputs &&
          this.$store.state.project.flowData.currentNodeItem.inputs.forEach(
            (ele, index) => {
              if (e.id == ele.id) {
                this.record_xPutIndex = index;
              }
            }
          );
        this.$store.state.project.flowData.currentNodeItem.inputData &&
          this.$store.state.project.flowData.currentNodeItem.inputData.forEach(
            (item, idx) => {
              if (e.key == item.key && e.description == item.description) {
                this.record_xPutDataIndex = idx;
              }
            }
          );
        // console.log(this.record_xPutIndex,this.record_xPutDataIndex);

        let allData = JSON.parse(
          JSON.stringify(
            this.$store.state.project.flowData.currentNodeItem.inputData
          )
        );
        allData &&
          allData.forEach(ele => {
            if (e.key.toString() === ele.key.toString()) {
              this.reviewFieldsList = ele.dataFields;
            }
          });
      } else if (type === "output") {
        this.record_xPutIndex = null;
        this.record_xPutDataIndex = null;
        this.$store.state.project.flowData.currentNodeItem.outputs &&
          this.$store.state.project.flowData.currentNodeItem.outputs.forEach(
            (ele, index) => {
              if (e.id == ele.id) {
                this.record_xPutIndex = index;
              }
            }
          );
        this.$store.state.project.flowData.currentNodeItem.outputData &&
          this.$store.state.project.flowData.currentNodeItem.outputData.forEach(
            (item, idx) => {
              if (e.key == item.key && e.description == item.description) {
                this.record_xPutDataIndex = idx;
              }
            }
          );
        // console.log(this.record_xPutIndex,this.record_xPutDataIndex);

        // console.log(this.$store.state.project.flowData.currentNodeItem.outputData);
        let allData = JSON.parse(
          JSON.stringify(
            this.$store.state.project.flowData.currentNodeItem.outputData
          )
        );
        allData &&
          allData.forEach(ele => {
            if (e.key.toString() === ele.key.toString()) {
              this.reviewFieldsList = ele.dataFields;
            }
          });
      }

      // console.log(this.reviewFieldsList);

      // this.handleChangeSel('keyAdd')
      this.addNodeDialog = true;
      this.setArrayStorage = [];

      // console.log(this.dataSource);
      let idList = [];
      let contentList = { checkedNodes: [] };
      this.dataSource &&
        this.dataSource.forEach(val => {
          idList.push(val.id);
          contentList.checkedNodes.push(val);
          val.sourcePortId &&
            val.sourcePortId.forEach(item => {
              idList.push(item.id);
              contentList.checkedNodes.push(item);
            });
        });

      this.$nextTick(() => {
        this.$refs.checkedElTreeRef.setCheckedKeys(idList); //勾选所有el-tree
        this.handleCheckFunc(null, contentList); //获取所有勾选后 获取到的字段 给el-table

        // console.log(this.itemTree);
        // console.log(this.reviewFieldsList);
        let newList = [];
        this.itemTree &&
          this.itemTree.forEach(val => {
            this.reviewFieldsList &&
              this.reviewFieldsList.forEach(ele => {
                if (val.oldId.toString() === ele.oldId.toString()) {
                  newList.push(val);
                }
              });
          });

        //回显table选中字段
        this.$nextTick(() => {
          newList &&
            newList.forEach(row => {
              this.$refs.newFieldsRef.toggleRowSelection(row, true);
            });
        });
      });
    },

    //新增节点确定
    newNodeAddConfirm(type) {
      // console.log(this.$refs.newFieldsRef.selection);
      // return

      if (type === "input") {
        // console.log(this.nodeEditItem);
        // console.log(this.addFields);
        let newData = {
          description: this.nodeEditItem.description,
          key: this.nodeEditItem.key,
          type: "INPUT",
          dataFields: this.$refs.newFieldsRef.selection
        };
        this.$store.state.project.flowData.currentNodeItem.inputs.push(
          this.nodeEditItem
        );
        this.$store.state.project.flowData.currentNodeItem.inputData.push(
          newData
        );
      } else if (type === "output") {
        let newData = {
          description: this.nodeEditItem.description,
          key: this.nodeEditItem.key,
          type: "OUTPUT",
          dataFields: this.$refs.newFieldsRef.selection
        };
        this.$store.state.project.flowData.currentNodeItem.outputs.push(
          this.nodeEditItem
        );
        this.$store.state.project.flowData.currentNodeItem.outputData.push(
          newData
        );
      }

      this.cancelAddNode();
      // this.closeMergeDialog() //"选择合并" 弹框 的关闭按钮 集成
    },

    //节点修改保存
    nodeModifySave(type) {
      // console.log(type);
      // console.log(this.record_xPutIndex,this.record_xPutDataIndex);

      if (type === "input") {
        // console.log(this.nodeEditItem);
        // console.log(this.addFields);
        let newData = {
          description: this.nodeEditItem.description,
          key: this.nodeEditItem.key,
          type: "INPUT",
          dataFields: this.$refs.newFieldsRef.selection || []
        };

        // console.log(this.nodeEditItem);
        console.log(newData);

        this.$store.state.project.flowData.currentNodeItem.inputs[
          this.record_xPutIndex
        ] = JSON.parse(JSON.stringify(this.nodeEditItem));

        if (this.record_xPutDataIndex === 0 || this.record_xPutDataIndex > 0) {
          this.$store.state.project.flowData.currentNodeItem.inputData[
            this.record_xPutDataIndex
          ] = JSON.parse(JSON.stringify(newData));
        } else {
          // console.log(this.reviewFieldsList);
          this.$store.state.project.flowData.currentNodeItem.inputData[0] = JSON.parse(
            JSON.stringify(newData)
          );
        }

        // console.log(JSON.parse(JSON.stringify(this.$store.state.project.flowData.currentNodeItem.inputData)));

        // this.$store.state.project.flowData.currentNodeItem.inputs.push(this.nodeEditItem)
        // this.$store.state.project.flowData.currentNodeItem.inputData.push(newData)
      } else {
        let newData = {
          description: this.nodeEditItem.description,
          key: this.nodeEditItem.key,
          type: "OUTPUT",
          dataFields: this.$refs.newFieldsRef.selection || []
        };
        this.$store.state.project.flowData.currentNodeItem.outputs[
          this.record_xPutIndex
        ] = JSON.parse(JSON.stringify(this.nodeEditItem));

        if (this.record_xPutDataIndex === 0 || this.record_xPutDataIndex > 0) {
          this.$store.state.project.flowData.currentNodeItem.outputData[
            this.record_xPutDataIndex
          ] = JSON.parse(JSON.stringify(newData));
        } else {
          // console.log(this.reviewFieldsList);
          this.$store.state.project.flowData.currentNodeItem.outputData[0] = JSON.parse(
            JSON.stringify(newData)
          );
        }
      }

      this.cancelAddNode();
    },

    cancelAddNode() {
      this.$nextTick(() => {
        this.$refs.checkedElTreeRef.setCheckedKeys([]); //勾选所有el-tree
        this.handleCheckFunc(null, { checkedNodes: [] }); //获取所有勾选后 获取到的字段 给el-table
        if (this.$refs.newFieldsRef) {
          this.$refs.newFieldsRef.clearSelection();
        }
      });
      this.dataSource = [];
      this.addNodeDialog = false;
      this.showNodeEditDialog = false;
      this.showNodeEditDialogType = "";
      this.addFields = [];
      this.nodeEditItem = {};
      this.nodeDialogIsReview = false;
      this.reviewFieldsList = [];
    },

    pushFileToMainFunc() {
      // console.log(staticConfigJson);
      // return
      let newUrl = staticConfigJson.pushMainThreadUrl; // 'http://10.12.97.32:9989/mms.html'
      window.open(newUrl, "_blank");
    }
  },

  computed: {
    ...mapGetters(["switchingVariable", "httpServer"]),
    config() {
      return { accessToken: localStorage.accessToken };
    },
    flowData: function() {
      return this.$store.state.project.flowData;
    },
    currentNodeItem: function() {
      //点击工具组件获取输入输出参数
      // getToolName(this.$store.state.project.flowData.currentNodeItem.name).then(
      //   res => {
      //     console.log(
      //       "%c 🍠 res: ",
      //       "font-size:20px;background-color: #F5CE50;color:#fff;",
      //       res
      //     );
      //   }
      // );

      if (
        this.$store.state.project.flowData.currentNodeItem.name ==
        "文件传递-工具A"
      ) {
        this.filePath = "D:workdir\\run_task_num_1\\A";
      } else if (
        this.$store.state.project.flowData.currentNodeItem.name ==
        "文件传递-工具B"
      ) {
        this.filePath = "D:workdir\\run_task_num_1\\B";
      } else if (
        this.$store.state.project.flowData.currentNodeItem.name ==
        "文件传递-工具C"
      ) {
        this.filePath = "D:workdir\\run_task_num_1\\C";
      } else if (
        this.$store.state.project.flowData.currentNodeItem.name ==
        "文件传递-工具D"
      ) {
        this.filePath = "D:workdir\\run_task_num_1\\D";
      }
      if (
        this.$store.state.project.flowData.currentNodeItem.targetAlgorithm ==
          "com.tipdm.framework.dmserver.core.algo.unparallel.file.Parse" &&
        this.$route.path == "/home/projectTwo"
      ) {
        this.selectValue = this.$store.state.project.flowData.currentNodeItem.parseType;
      }
      this.searchFile();

      //////////////////////////////
      // console.log(this.$store.state.project.flowData.currentNodeItem);
      if (
        this.$route.path.indexOf("projectTwo") < 0 &&
        this.$store.state.project.flowData.currentNodeItem &&
        this.$store.state.project.flowData.currentNodeItem.fileParse &&
        this.$store.state.project.flowData.currentNodeItem.concatFilePath
      ) {
        this.selDataArray =
          this.$store.state.project.flowData.currentNodeItem.fileParse[0]
            .fields || [];
        this.fileNumClass = this.$store.state.project.flowData.currentNodeItem.fileParse;
        this.concatFilePath = this.$store.state.project.flowData.currentNodeItem.concatFilePath;
      }
      // console.log(this.fileNumClass);
      //////////////////////////////

      // ↓↓↓↓↓↓↓↓↓↓↓ 工具文件验证  判断可下载项↓↓↓↓↓↓↓↓
      // ↓↓↓↓↓↓↓↓↓↓↓ 工具文件验证  判断可下载项↓↓↓↓↓↓↓↓

      let thisCurrentNodeItemServerId = this.$store.state.project.flowData
        .currentNodeItem.id; //serverId
      let requestUrl =
        this.$route.query.id && this.$route.query.runId
          ? this.$store.state.global.httpServer +
            "/api/file/getExistFile/" +
            this.$route.query.id +
            "/" +
            this.$route.query.runId +
            "/" +
            thisCurrentNodeItemServerId
          : this.$store.state.global.httpServer +
            "/api/file/getExistFile/" +
            thisCurrentNodeItemServerId;
      this.$.ajax({
        url: requestUrl,
        method: "get",
        contentType: false, //"multipart/form-data",
        // data:fd,
        // processData: false,
        headers: {
          accessToken: localStorage.getItem("accessToken")
        },
        success: res => {
          // console.log(res)
          if (res && res.data) {
            this.canDownloadNameList = res.data || []; //可下载的 输出文件  文件名称
          }
        },
        error: err => {}
      });

      ///↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

      //当前节点操作项
      console.log(
        "%c 🍷 this.$store.state.project.flowData.currentNodeItem;",
        "color:#4fff4B",
        "flowData >>>>>>",
        JSON.parse(JSON.stringify(this.$store.state.project.flowData)),
        "flowData.currentNodeItem >>>>>>>>>>",
        JSON.parse(
          JSON.stringify(this.$store.state.project.flowData.currentNodeItem)
        )
      );

      // this.$store.state.project.flowData.links = []
      return this.$store.state.project.flowData.currentNodeItem;
    },
    unstructurOutList: function() {
      return this.currentNodeItem.outputs.filter(
        item => item.cat == "UNSTRUCT"
      );
    },
    unstructurIntList: function() {
      return this.currentNodeItem.inputs.filter(item => item.cat == "UNSTRUCT");
    },
    contentHeight() {
      var parentHeight = this.$store.state.project.flowData.propsContentHeight;
      return parentHeight - 44 * (this.currentNodeItem.tabs.length + 1);
    },
    propsContentStyle: function() {
      return this.$store.state.project.flowData.propsContentStyle;
    }
  },
  components: {
    PropItem
  }
};
</script>
